We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1323b90 commit 315be0eCopy full SHA for 315be0e
Search/linearSearch.js
@@ -6,7 +6,7 @@
6
*/
7
function SearchArray (searchNum, ar) {
8
var position = Search(ar, searchNum)
9
- if (position != -1) {
+ if (position !== -1) {
10
console.log('The element was found at ' + (position + 1))
11
} else {
12
console.log('The element not found')
@@ -16,7 +16,7 @@ function SearchArray (searchNum, ar) {
16
// Search “theArray” for the specified “key” value
17
function Search (theArray, key) {
18
for (var n = 0; n < theArray.length; n++) {
19
- if (theArray[n] == key) { return n }
+ if (theArray[n] === key) { return n }
20
}
21
return -1
22
0 commit comments