1 2 3 4
var arr = ['item one', 'item two', 'item three']; console.log(arr); // prints 'item one' console.log(arr); // prints 'item two' console.log(arr[arr.length - 1]); // prints 'item three'
In essence, array push() as mentioned above appends an element to the end of the array, so you can picture it like this:
this[this.length] = element;
- How to combine multiple Jira Boards in a single page view - August 27, 2017
- Twilio Signal 2016 - May 26, 2016
- Finding great WordPress Themes & Plugins - December 8, 2015