SHARE
TWEET

Untitled

a guest Mar 26th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const linearSearch = function(collection, query) {
  2.   for (let i = 0; i < collection.length; i++) {
  3.     if (collection[i] === query) {
  4.       return collection[i];
  5.     }
  6.   }
  7.   return 'Query not found!';
  8. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top