push and pop are more efficient than shift and unshift
since shift and unshift need to re-index
push O(1)
pop O(1)
shift O(N)
unshift O(N)
concat O(N)
slice O(N)
splice O(N)
sort O(NlogN)
forEach/map/filter/reduce... O(N)
push and pop are more efficient than shift and unshift
since shift and unshift need to re-index
push O(1)
pop O(1)
shift O(N)
unshift O(N)
concat O(N)
slice O(N)
splice O(N)
sort O(NlogN)
forEach/map/filter/reduce... O(N)