Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

... Notation In JavaScript

... allows an array to be expanded. 

Here is one way you can use it

let arr1 = ["one", "two"];
let arr2 = ["three", ...arr1,"four", "five"];

/*Please note that let arr2 =["three", arr1, "four", "five"] is legal but will yield something ifferent. The second set means that you are adding arr as ONE element whereas the ... means you are speading out the array.
  
 
PREVIOUS NEXT
Tagged: #Notation #In #JavaScript
ADD COMMENT
Topic
Name
7+7 =