Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How javascript spread operator works?

var num = [2, 4, 6, 8, 10];
console.log(...num)
//expected output: 2 4 6 8 10
console.log(88, ...num, 99) 
// added extra new elements before and after the spread operator
//expected output: 88 2 4 6 8 10 99
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #How #javascript #spread #operator
ADD COMMENT
Topic
Name
1+7 =