Glossary: Data Structures and Algorithms in JavaScript
Shifting
Also written: shift, unshift, splice
Moving items along an array to open or close a gap, which costs O(n). It is why unshift, shift and splice are slow on big arrays.
Glossary: Data Structures and Algorithms in JavaScript
Also written: shift, unshift, splice
Moving items along an array to open or close a gap, which costs O(n). It is why unshift, shift and splice are slow on big arrays.