JSFiddle - React, Tailwind, and code Playground
JavaScript
var colors = ["Yellow", "Blue"];
colors.push("Red");
colors[colors.length - 2] = "Black";
alert (colors);
alert(colors.shift());
colors.unshift("Green", "Orange");
alert (colors);
var colors = ["Yellow", "Blue"];
colors.push("Red");
colors[colors.length - 2] = "Black";
alert (colors);
alert(colors.shift());
colors.unshift("Green", "Orange");
alert (colors);