Hi Lea, I'm a big fan of using custom vanilla js for adding small functionalities to websites. I was a bit curious about the double negative in the spa condition. Is there a specific reason for it? It seems simpler to use:
You're super right, that's simpler :) the double !! is just coercion to boolean and not needed. Sometimes I like to do that if I need some kind of boolean variable like isSpa but it's not needed here :)
Thanks for the heads up!
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.
Hi Lea, I'm a big fan of using custom vanilla js for adding small functionalities to websites. I was a bit curious about the double negative in the
spa
condition. Is there a specific reason for it? It seems simpler to use:Have a good day!
You're super right, that's simpler :) the double
!!
is just coercion to boolean and not needed. Sometimes I like to do that if I need some kind of boolean variable like isSpa but it's not needed here :)Thanks for the heads up!