arrays | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

arrays

how to work with such arrays: var a= [[]]; who knows give a link to the source

15th Sep 2020, 1:58 PM
Aparty
Aparty - avatar
9 Answers
+ 3
It is an empty nested array, what sort of "work" are you thinking about with such empty array?
15th Sep 2020, 2:18 PM
Ipang
+ 3
Buddy your array only has one element (index 0), which is an empty array. You can't access a[1], left alone a[1][0], there is only one element with index 0. Can you describe your plan some more?
15th Sep 2020, 2:27 PM
Ipang
+ 3
Is that from SoloLearn? if so, please copy lesson link here so anyone can take a look. Otherwise share a link to the lesson ...
15th Sep 2020, 2:31 PM
Ipang
+ 3
Can you share a link to that code here please? I would like to study it ...
15th Sep 2020, 2:34 PM
Ipang
+ 2
So now the array snake is : [[x, y]].. Better to add link..
15th Sep 2020, 6:20 PM
Jayakrishna 🇮🇳
+ 1
well, something like that var a =[[]]; a[1][0];
15th Sep 2020, 2:20 PM
Aparty
Aparty - avatar
+ 1
I don't even know how to say it correctly, just there is some kind of lesson or something
15th Sep 2020, 2:28 PM
Aparty
Aparty - avatar
0
this is not sololear, when I studied someone else's code, I saw such lines of code and cannot understand how they work
15th Sep 2020, 2:33 PM
Aparty
Aparty - avatar
0
var x; var y; var snake=[[]]; snake[0][0]=x; snake[0][1]=y;
15th Sep 2020, 2:36 PM
Aparty
Aparty - avatar