Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Access Elements of an Array

const myArray = ['h', 'e', 'l', 'l', 'o'];

// first element
console.log(myArray[0]);  // "h"

// second element
console.log(myArray[1]); // "e"
 
PREVIOUS NEXT
Tagged: #JavaScript #Access #Elements #Array
ADD COMMENT
Topic
Name
9+8 =