I think the concepts of truthy and falsy values is both the best and worst thing about javascript. I love it when it works with me and hate it with my entire heart when it doesn't ¯\_(ツ)_/¯
With that said I would have written the snippet in the example as if (tokenInfo) :)
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.
I think the concepts of truthy and falsy values is both the best and worst thing about javascript. I love it when it works with me and hate it with my entire heart when it doesn't ¯\_(ツ)_/¯
With that said I would have written the snippet in the example as
if (tokenInfo)
:)