Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

spade operator typescript

let origArrayOne = [ 1, 2, 3];                          //1,2,3
let origArrayTwo = [ 4, 5, 6];                          //4,5,6
 
//Create new array from existing array
let copyArray = [...origArrayOne];                      //1,2,3
 
//Create new array from existing array + more elements
let newArray = [...origArrayOne, 7, 8];             //1,2,3,7,8 
 
//Create array by merging two arrays
let mergedArray = [...origArrayOne, ...origArrayTwo];   //1,2,3,4,5,6
Source by howtodoinjava.com #
 
PREVIOUS NEXT
Tagged: #spade #operator #typescript
ADD COMMENT
Topic
Name
1+2 =