JavaScript Array methods introduced in ECMAScript 1
JavaScript Array methods introduced in ECMAScript 1 Array.concat() The concat() method is used to join two or more arrays. This method does not change the existing arrays, but returns a new array with contains the value of merged arrays. Syntax: const new_array = array_1.concat(array_2, array_3, ..., array_n); Example: const one = ["a", "b"]; const two = ["c", "d"]; const three = ["e", "f"]; const result = one.concat(two, three); console.log(result); // Output: ["a", "b", "c", "d", "e", "f"] Array.join() The join() methods create a new string by concatenating all of the elements of in an array. The elements in the array will be separated by separator. The default separator is comma(,). This method does not change the original array. Syntax: const str = array.join(separator); Example: const nameArray = ["p", "r", "a...