GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — search/ (#143) · Algorithms-Learn/JavaScript@315be0e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Search
    • linearSearch.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Search/linearSearch.js‎

Copy file name to clipboardExpand all lines: Search/linearSearch.js
+2-2Lines changed: 2 additions & 2 deletions
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 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.