Skip to content

Commit 315be0e

Browse files
authored
search/ (#143)
1 parent 1323b90 commit 315be0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Search/linearSearch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
function SearchArray (searchNum, ar) {
88
var position = Search(ar, searchNum)
9-
if (position != -1) {
9+
if (position !== -1) {
1010
console.log('The element was found at ' + (position + 1))
1111
} else {
1212
console.log('The element not found')
@@ -16,7 +16,7 @@ function SearchArray (searchNum, ar) {
1616
// Search “theArray” for the specified “key” value
1717
function Search (theArray, key) {
1818
for (var n = 0; n < theArray.length; n++) {
19-
if (theArray[n] == key) { return n }
19+
if (theArray[n] === key) { return n }
2020
}
2121
return -1
2222
}

0 commit comments

Comments
 (0)