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.

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more