Discussion: The Grocery List
Execute the code to understand the output and gain insights into how JavaScript arrays handle elements vs. properties.
We'll cover the following...
Verifying the output
Now, it’s time to execute the code and observe the output.
Press + to interact
const groceryList = [];groceryList[0] = "Bread";groceryList[1] = "Milk";groceryList.user = "John";console.log(groceryList.length);