Skip to content

Commit 92e1b4a

Browse files
authored
Update linear_search.js
1 parent 8a28805 commit 92e1b4a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
const linearSearch = function(arr, val) {
1+
const linearSearch = (arr, val)=> {
22
for (let i = 0; i < arr.length; i++ ) {
3-
if (arr[i] == val) {
4-
return i;
5-
}
3+
if (arr[i] == val) return i;
64
}
75
return -1;
8-
}
6+
};
97
module.exports = linearSearch;

0 commit comments

Comments
 (0)