+ 2

I created an array of arrays and looped through it but it only returned the first element. Can someone tell me why please...

7th May 2020, 1:39 AM
Prosper Emebo
Prosper Emebo - avatar
15 odpowiedzi
+ 6
Make sure your 'accountr' is a 2d array! You can check if it's a 2d array by console logging it :)) However, you can add the full code.
7th May 2020, 2:30 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 5
Here's how you loop through a 2D Array (array inside an array) : https://code.sololearn.com/WiROelRr88R8/?ref=app However, you can add your code too :))
7th May 2020, 1:50 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 4
Emebo Prosper Please add your code then :))
7th May 2020, 2:00 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 2
Emebo You are not calling the currentAccount function :)) However, if you call it like : currentAccount(); You'll get an error like 'Can't access localStorage'. This is because local storage doesn’t support on SoloLearn :))
7th May 2020, 2:13 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 1
I have tried that it is not working
7th May 2020, 2:00 AM
Prosper Emebo
Prosper Emebo - avatar
+ 1
The current function is in the event loop
7th May 2020, 2:21 AM
Prosper Emebo
Prosper Emebo - avatar
+ 1
It is waiting for the click event
7th May 2020, 2:21 AM
Prosper Emebo
Prosper Emebo - avatar
+ 1
I am not running it on solo learn
7th May 2020, 2:27 AM
Prosper Emebo
Prosper Emebo - avatar
+ 1
It on my browser
7th May 2020, 2:27 AM
Prosper Emebo
Prosper Emebo - avatar
7th May 2020, 2:08 AM
Prosper Emebo
Prosper Emebo - avatar
0
Can i send you the full folder
7th May 2020, 2:32 AM
Prosper Emebo
Prosper Emebo - avatar
0
Just to check it out.
7th May 2020, 2:33 AM
Prosper Emebo
Prosper Emebo - avatar
0
Prehaps on mail.
7th May 2020, 2:33 AM
Prosper Emebo
Prosper Emebo - avatar
0
i'm not trying to get the elements in the child array but the parent. [ [1,2,3,4], // these ones [5,6,7,8] // these ones ] not the element in it.
7th May 2020, 3:02 AM
Prosper Emebo
Prosper Emebo - avatar
- 1
Привет
7th May 2020, 5:19 PM
Evgeniy