I add some strings in an array.
console.log(arr1); // ['product_1']
let arr2 = arr1.push(name);
console.log(arr2); // 2
Why I receive number 2 in the second log when name is a String too?
- I tried also let arr2 = arr1.slice().push(name); without success.