in javascript how would I create an empty array of a given size
Psuedo code:
X = 3; createarray(myarray, X, \"\");
output:
Try using while loop, Array.prototype.push()
while
Array.prototype.push()
var myArray = [], X = 3; while (myArray.length < X) { myArray.push("") }
Alternatively, using Array.prototype.fill()
Array.prototype.fill()
var myArray = Array(3).fill("");