+ 1

What is the syntax of Array containing 1 integer???

var name=new Array(3); The above statement creates empty array with length of 3 elements. What is the syntax of Array containing 1 integer???

22nd Apr 2017, 5:43 PM
Sandip Bhambre (Sandy)
Sandip Bhambre (Sandy) - avatar
3 Respostas
+ 6
var myArr = [42]; this is an array with one element, the number 42 just another valid way to go
22nd Apr 2017, 6:20 PM
Burey
Burey - avatar
+ 1
if you do var arr=new Array() arr(0)=1 you have an array with one integer
22nd Apr 2017, 5:50 PM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar
Quente hoje
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes
APIs
1 Votes