- Definition: Adds one or more elements to the end of an array and returns the new length of the array.
- Syntax:
array.push(element1[, ...[, elementN]]) - Example:
let arr = [1, 2, 3]; arr.push(4, 5);
console.log(arr); // Output: [1, 2, 3, 4, 5]
| // Date Object CheatSheet | |
| // The Date object is used to work with dates and times. | |
| // More: http://www.w3schools.com/jsref/jsref_obj_date.asp | |
| // 1. Instantiating a Date. | |
| var date = new Date(); | |
| var date = new Date(milliseconds); |