- PUSH The push() method adds new elements to the end of an array and returns the new length.
const arr = ["The", "coding"];
arr.push("Master");
- SLICE The slice() method selects a part of an array and returns the new array.
const arr = ["The", "Coding", "Master"];
arr.slice(1,2);
- TOSTRING The toString() method converts an array to a string and returns the result.
const arr = ["The", "Coding", "Master"];
arr.tostring();
- SHIFT The shift() method removes the first element of the array and returns that element.
const arr = ["The", "Coding", "Master"];
arr.shift();
- MAP The map() method creates a new array with the result of calling a function of every array element.
const arr = [1, 4, 9, 16];
arr.map( x => x * 2);//[2, 8, 16, 32]
- POP The pop() method removes the last element of an array and returns that element.
const arr = ["The", "Coding", "Master"];
arr.pop();
- FILTER The filter() method creates an array filled with all array elements that pass a test (provided as a function).
const arr = ["The", "Coding", "Master"];
arr.filter(word => word.length > 3);
- INCLUDES The includes() determines whether an array contains s specified element.
const arr = ["The", "Coding", "Master"];
arr.includes("Coding");