const vegetables = ["carrot", "tomato", "lettuce"];
vegetables.price = 500;
console.log(vegetables); // (3) ["carrot", "tomato", "lettuce"]
console.log(veggies.price); // 500
I'm intrigued as to why the line vegetables.price = 500;
doesn't throw an error. Can someone please explain this in simple terms?
Thank you for taking the time to read this.
Any assistance would be greatly appreciated.