What’s happening:
I have tried dot notation my answer being:
foods.bananas = ‘13’;
foods.grapes = ‘35’;
foods.strawberries = ‘27’;
As well as this i have tried multiple different ways including the hinted way and even that isn’t working leading me to believe I am doing something obviously wrong, please somebody point it out too me.
My code so far
let foods = {
apples: 25,
oranges: 32,
plums: 28
};
// Only change code below this line
foods[bananas] = '13';
foods[grapes] = '35';
foods[strawberries] = '27';
// Only change code above this line
console.log(foods);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Challenge: Basic Data Structures - Add Key-Value Pairs to JavaScript Objects
Link to the challenge: