A boolean is unnecessary since values have truthiness and falsiness - -1 will become a falsy value (0), everything else will be truthy (negative numbers). Converting manually to a Boolean is inefficient and unnecessary
-1
Oh yeah that's true, didn't think of that way.
Thank you!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
A boolean is unnecessary since values have truthiness and falsiness -
-1will become a falsy value (0), everything else will be truthy (negative numbers). Converting manually to a Boolean is inefficient and unnecessaryOh yeah that's true, didn't think of that way.
Thank you!