Someone Explain This Javascript Snippet - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Someone Explain This Javascript Snippet (1053 Views)
1 Reply
| Someone Explain This Javascript Snippet by NaHiim(op): 11:17am On Jan 31, 2018 |
Please house, forgive my ignorance but I've been trying to wrap my head around the bolded code. I need someone to please explain. var bricks = []; for (var c=0 ; c<column ; c++) { bricks[c] = []; for (r=0 ; r<row ; r++) { bricks[c][r] = {x:0, y:0}; } } |
| Re: Someone Explain This Javascript Snippet by codemarshal08(m): 11:22am On Jan 31, 2018 |
NaHiim:bricks[c][r] = {x:0, y:0}; => this line is assigning an object literal to the cell in cth column, rth row in the bricks multidimensional arrays |
HELP With This Javascript Problem • Can Someone Help Me With With This Javascript Exercise Please • Help Me With This Javascript Problem • 2 • 3 • 4
Learn Mobile App Development • Please Help Me Solve These C# Questions • Gurus, What Can I Do In IT, Please?