+ 1

Var a= New Array(3) vs Store 3 in an array a.

How do I store an integer value 3 in an Array with “New Array”?

13th Jun 2018, 11:30 PM
Corey
3 odpowiedzi
+ 5
You could do this. A one element array filled with a 3. var a = new Array(1).fill(3);
14th Jun 2018, 1:04 AM
John Wells
John Wells - avatar
+ 1
sorry I thought this QA discussion part is for JS only. I am referring to JS.
14th Jun 2018, 1:00 AM
Corey
0
You should say what language you have this questions (and use the tag) so people can help you easier.
14th Jun 2018, 12:40 AM
Doodles
Doodles - avatar