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 — Added array searching and also to string methods · ranvirgorai/JavaScript-Lessons@aa2c549

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Data_Structures/Arrays_Searching_and_More
    • README.md
    • main.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Data_Structures/Arrays_Searching_and_More/README.md‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Title
2+
3+
Description
Collapse file

‎Data_Structures/Arrays_Searching_and_More/main.js‎

Copy file name to clipboard
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
3+
let items = [40, 68, 58, 12, 80, 37, 13, 63, 42, 3, 58];
4+
console.log(items.indexOf(12)); // 3
5+
console.log(items.indexOf(99)); // -1 (not found)
6+
console.log(items.indexOf(58)); // 2
7+
console.log(items.lastIndexOf(58)); // 10
8+
9+
console.log('--------------------');
10+
11+
let numbers = [10, 32, 53, 99, 60];
12+
console.log(numbers.toString()); // comma separated list
13+
console.log(numbers.join('~')); // to use a different separator

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.