I found the following code and I don't know what is the difference between A and B:
var fruits = ["Banana", "Orange", "Apple", "Mango"];
A
fruits.splice(2,0,["Lemon", "Kiwi"]);
B
fruits.splice(...[2,0].concat(["Lemon", "Kiwi"]));
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var A = fruits.splice(2, 0, ["Lemon", "Kiwi"]);
var B = fruits.splice(...[2, 0].concat(["Lemon", "Kiwi"]));
console.log(A)
console.log(B)
question from:https://stackoverflow.com/questions/51287428/how-does-the-spread-syntax-affect-array-splice