Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nesting arrays javascript

//Sorry for any grammer or syntax mistakes ahead of time ;)

//Make a nested array
let pets = [["cat", "Purasama"], ["dog", "Woofus"]];
//Refer to a nested array
console.log(pets[0]); //Returns "["cat", "Purasama"]"
console.log(pets[1][1]); //Returns "Woofus"
 
PREVIOUS NEXT
Tagged: #nesting #arrays #javascript
ADD COMMENT
Topic
Name
3+1 =