0

Multi dimensional array is not working also don't understand how it works. Please help

https://code.sololearn.com/W7wnsTbYqdYH/?ref=app

1st Aug 2020, 11:58 AM
Avinash
4 Respuestas
+ 1
Why do you expect mynewArray to work ? Did you created a constructor function for it since you are created an new object for it(mynewArray) ,to declare a array you need to use the built in Array() constructor for creating array objects I think you should go through some tutorials online and through the course in here as well to understand how to work with arrays
1st Aug 2020, 12:59 PM
Abhay
Abhay - avatar
+ 1
Someone thanks again. 🙏🙏🙏
3rd Aug 2020, 1:43 PM
Avinash
0
Not helpful. Please anyone there who can make me understand Someone Sneh Chauhan
2nd Aug 2020, 5:15 PM
Avinash
0
Avinash to declare a array you should call Array instead of myNewArray. And a typo in the last line : document.write(myArray1[i][j + "&emsp"]); In this line you are trying to access myArray1's i th row's j+"&emsp" th value (which always returns undefined). You may be trying to add   char at the end of each number in the array. If so then it should be document.write(myArray1[i][j]+ " "); (also an html character code should begin with an '&' and end with ';'). Corrected code : https://code.sololearn.com/WKMtnfg1P79Z/?ref=app
3rd Aug 2020, 1:57 AM
Roopesh
Roopesh - avatar