With the former, you can also get more info about the variable just from how it's used.
dog allows you to access the value of the myDict property, yes. But myDict.dog not only allows a developer to access the value, but it also allows for the dev to know immediately that the variable is a property of an object, which can give a clue on where to look to get more insight into the larger object itself.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Maybe I'm a dinosaur, but I don't always find arrow functions nor destructuring to be more readable/understandable.
This:
Is easily the more readable solution vs:
With the former, you can also get more info about the variable just from how it's used.
dog
allows you to access the value of themyDict
property, yes. ButmyDict.dog
not only allows a developer to access the value, but it also allows for the dev to know immediately that the variable is a property of an object, which can give a clue on where to look to get more insight into the larger object itself.