I\'ve a function read() that takes as a boolean paramater. If false is passed in - read(false) - it shouldn\'t run a block of code. It wo
read()
false
read(false)
If you're expecting falsey values, use typeof:
typeof
var x = typeof x !== 'undefined' ? x : false;
Otherwise, if you do this:
var x = x || true;
And pass in false, the value of x will be true.
x
true