Hacker News new | ask | show | jobs
by have_faith 3882 days ago
It makes no difference but for some reason I feel the urge to shorten the last line to:

lightsOn = !lightsOn;

I'll see myself out.

2 comments

Every time I write that in JavaScript, I delete it and just use ! As well haha
Don't forget to turn off the light on your way out.

lightsOn = !lightsOn || lightsOn