Learn 2D ARRAYS in JavaScript in 6 minutes! ⬜

preview_player
Показать описание
// 2D array = multi-dimensional array that stores a matrix
// of data in rows and columns.
// Useful for games, spreadsheets, or representing images

const matrix = [ [1, 2, 3],
[4, 5, 6],
[7, 8, 9]];

//matrix[0][0] = 'X';
//matrix[0][1] = 'O';
//matrix[0][2] = 'X';

//matrix[1][0] = 'O';
//matrix[1][1] = 'X';
//matrix[1][2] = 'O';

//matrix[2][0] = 'X';
//matrix[2][1] = 'O';
//matrix[2][2] = 'X';

for(let row of matrix){
}
Рекомендации по теме
Комментарии
Автор

// 2D array = multi-dimensional array that stores a matrix
// of data in rows and columns.
// Useful for games, spreadsheets, or representing images

const matrix = [ [1, 2, 3],
[4, 5, 6],
[7, 8, 9]];

//matrix[0][0] = 'X';
//matrix[0][1] = 'O';
//matrix[0][2] = 'X';

//matrix[1][0] = 'O';
//matrix[1][1] = 'X';
//matrix[1][2] = 'O';

//matrix[2][0] = 'X';
//matrix[2][1] = 'O';
//matrix[2][2] = 'X';

for(let row of matrix){
const rowString = row.join(' ');
console.log(rowString);
}

BroCodez
Автор

<*_> This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal. <_*>

piotrmazgaj
Автор

I love this short simple lesson! Thank you for the video!

LuckyLukeCarReview
Автор

Bro u know that u r saving my programming grade in school. I love ur vids❤

bernhardstelzhammer
Автор

he aint the goat but he fit the description 🐐🐐🐐🐐🔥🔥🔥🔥

kwlmtcb
Автор

thanks bro. useful for some refreshing, i already learned these with your older tutorial

hunin
Автор

Ok, cool. Now how do I create an empty matrix with varying length?

qhsnizk
Автор

Great video. Can you please make a video about lua. I just don't understand arrays.

deadshot
Автор

Would be very useful to make this video in C++!!!

ejjgjwk
Автор

Hey bro Can you make django course if you can

mkmdpum
Автор

Hello bro code please make small small project in javascript

sportsknowledge