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 — Working on courses · Praj1097/JavaScript-Lessons@4a82799

File tree

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

‎Data_Structures/Arrays/main.js‎

Copy file name to clipboardExpand all lines: Data_Structures/Arrays/main.js
+1-10Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ var food = ['bacon', 'corn', 'sausage'];
44
console.log(food[2]);
55
console.log(food.length);
66

7-
console.log('----------');
8-
97
// loop over an array
108
for(var i=0; i<food.length; i++){
119
console.log(i, food[i]);
@@ -17,33 +15,26 @@ food.forEach(function (index, item) {
1715
console.log(item, index);
1816
});
1917

18+
console.log('----------');
2019

2120
// add new items to an array
2221
food.push('tuna');
2322
console.log(food);
2423

25-
console.log('----------');
26-
2724
// remove item from the end of an array
2825
var lastItem = food.pop();
2926
console.log(lastItem);
3027
console.log(food);
3128

32-
console.log('----------');
33-
3429
// remove item from the beginning of an array
3530
var firstItem = food.shift();
3631
console.log(firstItem);
3732
console.log(food);
3833

39-
console.log('----------');
40-
4134
// add item to beginning of an array
4235
food.unshift('apples');
4336
console.log(food);
4437

45-
console.log('----------');
46-
4738
// remove item by index position
4839
var pos = 1;
4940
food.splice(pos, 1);
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
-1Lines changed: 0 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Note: This is just for me *(Bucky)* to keep track of all my lessons on YouTube,
1212
- promise
1313
- prototypes
1414
- recursion
15-
- score
1615
- **Data Structures**
1716
- arrays
1817
- dictionaries

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.