3 ms·
.unshift - makes it bigger. Longer word than .shift .shift - makes it smaller. Shorter word than .unshift
by da02 13y ago
.unshift - makes it bigger. Longer word than .shift
.shift - makes it smaller. Shorter word than .unshift
- ronaldx 13y agoI could never remember this until someone told me to imagine that an array is like a row of chairs at a cinema. "Shift" will shift everyone up one, bumping someone off the start of the row.