Code not executing

Tell us what’s happening:
i’m not too sure whats wrong with my code. I ran it outside the freecodecamp compiler and it worked fine. i’m unsure if there’s a more efficient way to solve this problem or if my code is wrong altogether. aAny help would be appreciated.

  **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

  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36

Challenge: Access Property Names with Bracket Notation

Link to the challenge:

Your code is fine, try clearing the browser cache or use a different browser.

Your code passes for me. What browser are you using? Have you updated it recently? Have you tried resetting the challenge? Do you have any browser extensions running?

I guess it was a strange bug, the code passed when i tried again today.
Thanks for the help!

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