const sum = [1, 2, 3].reduce((acc, curr) => acc + curr, 0);
console.log(sum); // 6
const index = [1, 2, 3].indexOf(3);
console.log(index); // 2
const length = [1, 2, 3].length;
console.log(length); // 3
const filled = new Array(3).fill(0);
console.log(filled); // [0, 0, 0]
const arr = [3, 2, 1];
const ascending = arr.sort((a, b) => a - b);
console.log(ascending); // [1, 2, 3]
const descending = arr.sort((a, b) => b - a);
console.log(descending); // [3, 2, 1]
const copied = Array.from([1, 2, 3]);
console.log(copied); // [1, 2, 3]
const mapped = [1, 2, 3].map(x => x * 2);
console.log(mapped); // [2, 4, 6]
const filtered = [1, 2, 3].filter(x => x > 1);
console.log(filtered); // [2, 3]
const split = "hello world".split(' ');
console.log(split); // ["hello", "world"]
const reversed = [1, 2, 3].reverse();
console.log(reversed); // [3, 2, 1]
const joined = ['hello', 'world'].join(' ');
console.log(joined); // "hello world"
const matched = "hello world".match(/[aeiou]/gi);
console.log(matched); // ["e", "o", "o"]