Basic Data Structures - Access Property Names with Bracket Notation

Tell us what’s happening:
i can’t see what is wrong with my code
i’m still not passed
Your code so far

let foods = {
  apples: 25,
  oranges: 32,
  plums: 28,
  bananas: 13,
  grapes: 35,
  strawberries: 27
};

function checkInventory(scannedItem) {
  // Only change code below this line
return foods[scannedItem];

  // Only change code above this line
}

console.log(checkInventory("apples"));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

Challenge: Basic Data Structures - Access Property Names with Bracket Notation

Link to the challenge:

Hi there. It works for me as written. What errors do the tests say?

it has passed today without changing anything
yesterday it got stuck i had to stop for the day

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.