DEV Community

Darshan Kumar
Darshan Kumar

Posted on

1

Methods of Array in Javascript

Image description

push(): Adds one or more elements to the end of an array and returns the new length.
pop(): Removes the last element from an array and returns that element.
shift(): Removes the first element from an array and returns that element.
unshift(): Adds one or more elements to the beginning of an array and returns the new length of the array.
concat(): Returns a new array that combines two or more arrays.
slice(): Returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included).
splice(): Changes the contents of an array by removing or replacing existing elements and/or adding new elements
filter(): Creates a new array with all elements that pass the test implemented by the provided function.
join() : The join() method joins all elements of an array into a string.

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay