Editing Arrays

Array manipulation: shift, unshift, pop, concat, length, join, push

.length is not from 0 index but 1

.join – the ‘joiner’ adds words between items

There is no joiner after the last item.

.push adds an index to the end of the array

.unshift adds named thing to 0 index

.shift removed first element of array (accepts no params)

.pop removes last item of array (accepts no params)

.concat concatenates arrays

.slice returns a shallow copy of a portion of an array into a new array object

.splice changes the content of an array by removing existing elements and/or adding new elements.

.every() method tests whether all elements in the array pass the test implemented by the provided function

.some() method tests whether some element in the array passes the test implemented by the provided function

Peter Dillon

Development teams seek me out for visual design, reskinning, information hierarchy, usability, iconography, improving task flow, improving the front end build process and more. I specialize in creating engaging solutions to solve real world problems while designing beautiful applications that make the lives of users easier.