Skip to content

Instantly share code, notes, and snippets.

@mohitmamoria
Created October 7, 2013 05:15
Show Gist options
  • Save mohitmamoria/6862852 to your computer and use it in GitHub Desktop.
Save mohitmamoria/6862852 to your computer and use it in GitHub Desktop.
You There, Bro?
// first, some awesomeness
Array.prototype.YouThereBro = [].indexOf
// now, some awesomeness++
var arr = [20, 8, 19, 93]
arr.YouThereBro(8) // you there bro?
// >> 1 (yep)
arr.YouThereBro(93) // you there bro?
// >> 3 (yep)
arr.YouThereBro(11) // you there bro?
// >> -1 (nope)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment