Can you hack this? #1

alfredosalzillo

Alfredo Salzillo

Posted on March 10, 2021

Can you hack this? #1

Say that we have a function called nameEqualsToItself how accept a person object as input that checks if the name property of the input object equal the same name property of the input object implemented like this:

const nameEqualsToItself = (person) => person.name === person.name
Enter fullscreen mode Exit fullscreen mode

Can you find the input that makes nameEqualsToItself return false?

const personX = ???
console.log(nameEqualsToItself(personX)) // print `false`
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
alfredosalzillo
Alfredo Salzillo

Posted on March 10, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related