Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create javascript array with no values

// This...
let arr = new Array(arrayLength)

// ...results in the same array as this
let arr = Array(arrayLength)

// This has exactly the same effect
let arr = []
arr.length = arrayLength
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #create #javascript #array #values
ADD COMMENT
Topic
Name
2+9 =