Guest User

Untitled

a guest
Jan 22nd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. function find_needle(haystack) {
  2. var needleIndex = haystack.IndexOf('needle');
  3. return 'found the needle at position' + needleIndex;
  4. }
  5.  
  6. find_needle(['hay', 'junk', 'hay', 'hay', 'moreJunk', 'needle', 'randomJunk'])
Add Comment
Please, Sign In to add comment