Regarding this lesson: https://www.codecademy.com/courses/introduction-to-javascript/lessons/objects/exercises/nested-objects?action=resume_content_item
I’m working on question 1. I defined an object literal that I named ‘capFave’. In order to get the value ‘cookies’ from another object literal, I used a function.
const capFave = {
favFood () {
return spaceship.crew.captain['favorite foods'][0]
// not correct i'm pretty sure
}
}
when I console.log it:
console.log(capFave.favFood);
I expected ‘cookies’ instead I get “[Function: favFood]”.
There is no review video on this exercise. Any insight would be greatly appreciated.