JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://www.frontendvideo.org/static/js/console-to-dom.js"></script>
JavaScript
var foo = ['a', 'b', 'c', 'd', 'e', 'f'];
//the shift method removes the first element,
//and returns the removed element
console.warn('foo.shift() -> ' + foo.shift()); // a
console.info('foo.length -> ' + foo.length); // 5
console.dir(foo); // ['b', 'c', 'd', 'e', 'f']
console.warn('foo.shift() -> ' + foo.shift()); // b
console.info('foo.length -> ' + foo.length); // 4
console.dir(foo); // ['c', 'd', 'e', 'f']
console.warn('foo.shift() -> ' + foo.shift()); // c
console.info('foo.length -> ' + foo.length); // 3
console.dir(foo); // ['d', 'e', 'f']