JS
challenger
Home
JavaScript Basics
arrays
Access the Middle Element of an Array
Access the Middle Element of an Array
You have an array containing three snacks. Your friend wants the middle snack. Assign the middle element to the variable 'middleSnack'.
Premium
reset
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Erik"));
JavaScript
Run Code
Console