Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

two dimensional array traversing in javascript

const numbers = [
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9, 10, 11],
];

for (let i = 0; i < numbers.length; i++) {
  for (let j = 0; j < numbers[i].length; j++) {
    console.log(`Index Point [${i}, ${j}], value = ${numbers[i][j]}`);
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: file input only allow json 
Javascript :: deleting an instance in sequelize 
Javascript :: reset regex javascript 
Javascript :: how to check invalid control angular formcontrol name 
Javascript :: div diseaper going down 
Javascript :: Material-ui clock icon 
Javascript :: js jquery class ending with string 
Javascript :: javascript filter array of objects 
Javascript :: console.log object functions js 
Javascript :: alpinejs examples stackoverflow 
Javascript :: phaser generate frame numbers 
Javascript :: onselect in zebra datepicker 
Javascript :: js array reduce error not a function 
Javascript :: some js es6 
Javascript :: react js calendar 
Javascript :: Highlight current nav link in react 
Javascript :: javascript make title blink 
Javascript :: movement of objects in javascript 
Javascript :: javascript function declaration vs arrow function 
Javascript :: console.log full object 
Javascript :: angular debug chrome launch.json 
Javascript :: the rest operator javascript 
Javascript :: prop type for component react js 
Javascript :: jquery public function 
Javascript :: expo cli vs react native cli 
Javascript :: download string as file express js 
Javascript :: nohup nodemon 
Javascript :: js number to string 
Javascript :: sort array ij js 
Javascript :: this js 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =