pop() pop out the last element
push() push somthing to the end of the array
map(..)
Creates a new array by applying the callback function to every element of the starting array.
filter()
const staffNames = ["Nick", "", "Jacky", "", "Philena", "Leo"];
const validNames = staffNames.filter(name => name !== "");
// validNames = ["Nick", "Jacky", "Philena", "Leo"]
[...]symbol,can be used to copy array.
'[...array]' will unpacked the array elements into the new array.
array = [1, 2, 3];
let copiedArray2Times = [...array, ...array,2];//[1,2,3,1,2,3,2]
=== judge equal elements of the same type
== judge with force type transformation
(2== '2' is ture)
anonymous function
Syntax: (parameters) => output;
modify(array, x => x+2)