0

I'm pretty new to JS objects. Can anyone tell me why I am getting this result?

hey arnold

While my desired output is:

hey amy

Here's the code

function greet (person) {       
    if (person == { name: 'amy' }) {
        console.log('hey amy')
    } else {
        console.log('hey arnold')
    }
}
greet({ name: 'amy' })
Mohammad Usman
  • 37,952
  • 20
  • 92
  • 95

0 Answers0