const groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains']; groceryList.shift(); console.log(groceryList); groceryList.unshift('popcorn'); console.log(groceryList); console.log(groceryList.slice(1,4)); console.log(groceryList);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter