All About JavaScript Array Methods

JavaScript is one of the top most popular programming language for front-end web developers nowadays. For the popularity of javaScript in front-end development, Ryan Dahl develops another server-side runtime NodeJS for backend development. To simplify web development for the developers EcmaScript is adding many beautiful patterns to javaScript. Today I will try to discuss about the methods of the array in javaScript.

array.length()

This is always returns the number of elements in the array.

array.push()

Add a new items to the end of the array and returns index of new item.

array.pop()

Remove the last item in the array and return the removed item

array.shift()

Remove the first item in the array and return the removed item

array.unshift()

Add a new items to the start of the array and

array.reverse()

array.join(seperator)

Converts the array to a string and all items andseperated with the value of seperator paramitter.

array.filter()

This return a new array with all elements that pass the test implemented by the provided function.

array.find()

This return the first elements that matched the test implemented by the provided function.

array.forEach()

This return the provided functions return for each items in the array.

Thank you.

JavaScript Developer