Answers for "8.2. Working With Arrays 8.2.1. Bracket Notation and Index"

0

8.2. Working With Arrays 8.2.1. Bracket Notation and Index

//Use bracket notation and index to access items in an array.

let programmingLanguages = [
   "JavaScript", // index 0
   "Python",     // index 1
   "Java",       // index 2
   "C#"          // index 3
];
console.log(programmingLanguages[0]);
console.log(programmingLanguages[3]);

// What will happen when index 4 is requested?
console.log(programmingLanguages[4]);

//JavaScript
//C#
//undefined
Posted by: Guest on June-14-2021

Code answers related to "8.2. Working With Arrays 8.2.1. Bracket Notation and Index"

Code answers related to "Javascript"

Browse Popular Code Answers by Language