I created a JSperf comparison of all suggested answers.
TL;DR - the best option for all current browsers is:
val | 0;
.
Update:
It seems like these days they are all pretty identical, except that the Number() function is the slowest, while the best being val === true ? 1 : 0;.