This is something that I've always wondered. According to MDN, in JavaScript "The if statement executes a statement if a specified condition is true". So then why does this pass the statement?
var a = 7;
if( a ) {
alert('true');
} else {
alert('false');
}
The variable is neither true nor false, so why does it alert "true" instead of just skipping the entire if statement?