JSFiddle - React, Tailwind, and code Playground

by Serhii Tymchak

JavaScript

var colors = ["Yellow", "Blue"];

colors.push("Red");

colors[colors.length - 2] = "Black";

alert (colors);

alert(colors.shift());

colors.unshift("Green", "Orange");

alert (colors);