midudev / aprende-javascript-problemas

Repositorio para indicar problemas en la plataforma de Aprende JavaScript
https://aprendejavascript.dev
123 stars 4 forks source link

optional-chaining #318

Closed juanigna closed 1 year ago

juanigna commented 1 year ago

In the last challange there is an error: image Here the slogan of the task: For example. With the Ocean object that comes to us as the first parameter, we can explore the Deep place and look for the Treasure object. So we would try to access Ocean.deep.treasure. If we find it, the robot returns True and if he does not find it he returns False. We just need to know if we have found it or not, we do not need to know its value. I think in that test, the correct answer must be false

Guille-Sanchez commented 1 year ago

I think the answer is correct

The first item is an object, let's name it beach: {sand: {animal: 'puplo'}}

the second item is a string, key of the first object, lets name it result: beach['sand'] = {animal: 'pulpo'} this exists

the third is a string, key of the previous object: result['animal'] = 'pulpo' this exists

Since the value exists, it was found it, the function must return true. And the test expects true, so it is correct