Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
14 lines (9 loc) · 525 Bytes

File metadata and controls

14 lines (9 loc) · 525 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];
groceryList.shift() // remove the first item in the array
console.log(groceryList)
groceryList.unshift('popcorn') // adds popcorn to the start of the array
console.log(groceryList)
console.log(groceryList.slice(1,4)) // Slices the array from the starting index to ending one with the ending not included
console.log(groceryList)
const pastaIndex = groceryList.indexOf('pasta')
console.log(pastaIndex)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.