DEV Community

[Comment from a deleted post]
Collapse
 
mathieuhuot profile image
Mathieu Huot

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:

if(spa) {
    //rest of code.
}

Have a good day!

Collapse
 
learosema profile image
Lea Rosema (she/her)

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!