Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created July 24, 2023 16:45
Show Gist options
  • Save suhailgupta03/d92bfe27e72f077a0680f00fbad4c69e to your computer and use it in GitHub Desktop.
Save suhailgupta03/d92bfe27e72f077a0680f00fbad4c69e to your computer and use it in GitHub Desktop.
var list = [
[1, 2, 3, 4], // 0th index
[100, 101, 102, 199], // 1st index
[201, 202, 203, 299], // 2nd index
]; // multi-dimensional array
// also called a matrix
// above is a 3x4 matrix
var array1 = list[0];
console.log(array1);
var numberX = array1[1];
console.log(numberX);
var arrayY = list[2];
console.log(arrayY);
var numberZ = arrayY[3]; // 4th index inside arrayY
console.log(numberZ);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment