Skip to content

Commit

Permalink
feat(ayan-b#1): JS linear search
Browse files Browse the repository at this point in the history
  • Loading branch information
jarpi committed Oct 3, 2018
1 parent f76cc49 commit 54e6101
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ Linear search is a very simple search algorithm. In this type of search, a seque
|17| [Jirayu Saengwannakool](https://github.com/bankzxcv) || Thailand | Javascript,Golang |
|18| [Ryan Michalec](https://github.com/a3qz) || United States | F# |
|19| [Pulkit Jatav](https://github.com/paradoxpj) | | India | Python |
|20| [jarpi](https://github.com/jarpi) | | Spain | Javascript |
3 changes: 3 additions & 0 deletions javascript-linear-search/javascript-linear-search-3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const linearSearch = (arr, n) => {
return arr.length ? arr[0] === n || linearSearch(arr.slice(1), n) : false
}

0 comments on commit 54e6101

Please sign in to comment.