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 — Data structures Arrays Seraching README.md update · anubisant/JavaScript-Lessons@5eacaea

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Data_Structures/Arrays/Searching
    • README.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Data_Structures/Arrays/Searching/README.md‎

Copy file name to clipboardExpand all lines: Data_Structures/Arrays/Searching/README.md
+18-6Lines changed: 18 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
![](http://i.imgur.com/BgUMUGU.png)
22

33
# Searching
4-
This MD file serves as example/template. It will be filled up soon.
5-
6-
(for Bucky to fill up)
4+
In order to iterate an array more efficiently sometimes we have to search for the value instead of the place. The function **indexof()** helps us with that
75

86
# Course Documentation
97

10-
(this for me to fill up with every element that you use in lessons. syntax explaination and links for more)
118

12-
## Element to explain
9+
## .indexof()
10+
In our example:
11+
12+
13+
let items = [40, 68, 58, 12, 80, 37, 13, 63, 42, 3, 58];
14+
console.log(items.indexOf(12)); // 3
15+
console.log(items.indexOf(99)); // -1 (not found)
16+
console.log(items.indexOf(58)); // 2
17+
console.log(items.lastIndexOf(58)); // 10
18+
19+
20+
it is pretty forward that we use the function **.indexOF()** to find a specific value that is stored in our array.
21+
For finding the value "a" in the array "anarray" we are using the following syntax:
22+
23+
anarray.indexOF("a")
1324

14-
(for example console.log)
25+
1526

1627
##Javascript functions
1728

@@ -125,4 +136,5 @@ stack in order to remove things from it.
125136
- [Twitter](https://twitter.com/bucky_roberts)
126137
- [Google+](https://plus.google.com/+BuckyRoberts)
127138
- [reddit](https://www.reddit.com/r/thenewboston/)
139+
128140
> Written with [StackEdit](https://stackedit.io/).

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.