Array Methods
1. Accessing Elements
concat()
concat()const array1 = ['a', 'b', 'c'];
const array2 = ['d', 'e', 'f'];
const newArray = array1.concat(array2);
console.log(newArray); // Output: ['a', 'b', 'c', 'd', 'e', 'f']join()
join()const array = ['Hello', 'world', '!'];
const joinedString = array.join(' ');
console.log(joinedString); // Output: 'Hello world !'slice()
slice()const array = [1, 2, 3, 4, 5];
const slicedArray = array.slice(2);
console.log(slicedArray); // Output: [3, 4, 5]toString()
toString()indexOf()
indexOf()lastIndexOf()
lastIndexOf()2. Modifying Arrays
push()
push()pop()
pop()shift()
shift()unshift()
unshift()splice()
splice()fill()
fill()reverse()
reverse()3. Iteration and Transformation
forEach()
forEach()map()
map()filter()
filter()reduce()
reduce()some()
some()every()
every()