What Are The Methods of Array In JavaScript?

Bhuwan
0


  Javascript has several built-in array methods that can be used to manipulate arrays. Here are  some   common methods and their uses: 

  1. .push() - Adds elements to the end of an array
  2. .pop() - Removes the last element of an array
  3. .unshift() - Adds elements to the beginning of an array
  4. .shift() - Removes the first element of an array
  5. .slice() - Returns a shallow copy of a portion of an array
  6. .splice() - Adds/Removes elements from an array
  7. .sort() - Sorts the elements of an array
  8. .reverse() - Reverses the order of elements in an array
  9. .concat() - Joins two or more arrays into a new array
  10. .join() - Joins all elements of an array into a string

Tags

Post a Comment

0Comments
Post a Comment (0)