This class is all about array methods in Javascript
- This method is used to add an element to the end of an array.
- This method is used to remove the last element of an array.
- This method is used to remove the first element of an array.
- This method is used to add an element to the beginning of an array.
- This method is used to add or remove elements from an array.
- This method is used to return a shallow copy of a portion of an array into a new array object.
- This method is used to merge two or more arrays.
- This method is used to join all elements of an array into a string.
- This method determines whether an array contains a certain value among its entries.
- This method is used to return specific properties of an array.
For example:
const array = ["banana", "computer", "iphone"];
const [fruit, , mobile, ...rest] = array;
- This operator (...something) is another way of copy an array to new array object
const array = ["Hi", "there", "!"];
const newCopyArray = [...array];
console.log(newCopyArray);
- This creates a new array populated with the results of calling a provided function on every element in the calling array.