Sounds like a silly thing, but sometimes you want optional false parameters. If for nothing else than to make your parameters human readable, not just syntactically convenient.
So let’s start out:
1 2 3 4 5 | |
The trick here is to detect whether the variable is undefined, then for it’s truthy value. Fixed implementation:
1 2 3 4 5 6 7 8 | |
Pretty cool huh? Test with if/else structures or you will get errors.
Update: Thanks Toby for that one