Created
March 10, 2015 18:11
-
-
Save ElijahLynn/a13f1a314d95f599de99 to your computer and use it in GitHub Desktop.
meetupWaitlistNumber
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Taken from comment by Eli Hellmann @ http://www.meetup.com/AngularJS-NYC/events/221056642 | |
| Array.prototype.reduce.call($('#rsvp-list-waitlist li'), function(agg,e,i){return agg || (/Elijah Lynn/i.test($(e).text()) ? i : agg);},null) //:) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An attempt at making this a bit more readable.
Array.prototype.reduce.call($('#rsvp-list-waitlist li'), function (previousValue, currentValue, index, array) { return previousValue || (/Elijah Lynn/i.test($(currentValue).text()) ? index : previousValue); }, null );