Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function find_needle(haystack) {
- var needleIndex = haystack.IndexOf('needle');
- return 'found the needle at position' + needleIndex;
- }
- find_needle(['hay', 'junk', 'hay', 'hay', 'moreJunk', 'needle', 'randomJunk'])
Add Comment
Please, Sign In to add comment