📘array methods
JS ⟩ object ⟩ built-in ⟩ Array ⟩ methods
push() - append element.
pop() - remove and return last element.
unshift() - prepend element.
shift() - remove and return first element.
splice - delete/insert elements.
filter elements
filter - "holes" are removed automatically.
combine elements
join - 連接所有元素、合併成一個字串。
reduce((result, element, index, array) => {...}) -
reduceRight - reduce array from highest index to lowest. (from right to left)
find & search elements
sort elements
reverse - reverse an array in place.
transform arrays/elements
Last updated