It may be stupid but I really stuck with dot dot dot array(...[ ])
I was playing with arrays and I recently noticed a fact I don't understand.
Consider this function in Node.js environment:
function test(name, age, adress) {
console.log(Array.from(arguments));
console.log(...Array.from(arguments));
}
the output is:
// [ 'john', 25, 'new york' ]
// john 25 new york
I thought the second line was a concatenation(strng) of the array values (arguments) until I execute this function in chrome's console:
So my questions is:
- does the second output is an array ?
- If yes, what is the difference between these two arrays ?
- What ...[array] actually does ?
Thanks in advance