Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

spread operator javascript

//Spreed Operator
const price = [100, 150, 200, 300, 400];
const price2 = [500, 550, 600, 10];
const price3 = [35, 60, 70];

const allPrice = [...price, ...price2, ...price3];  //using three dots means spread operator
console.log(allPrice);  //100, 150, 200, 300, 400, 500, 550, 600, 10, 35, 60, 70]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #spread #operator #javascript
ADD COMMENT
Topic
Name
1+7 =