daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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'])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top