js for concat array string code example
Example 1: concatenate javascript array
const fruits = ['apple', 'orange', 'banana'];
const joinedFruits = fruits.join();
console.log(joinedFruits); // apple,orange,banana
Example 2: array concat in javascript
const letters = ['a', 'b', 'c'];
const numbers = [1, 2, 3];
const newArray = letters.concat(numbers);
// newArrat is ['a', 'b', 'c', 1, 2, 3]