Someone Please explain what is going on here.
var y = 1;
if (function f(){return 'some text';}) {
y += typeof f;
}
console.log(y);// "1undefined"
if i change it into function expression
var y = 1;
if (a = function f(){return 'some text';}) {
y += typeof a;
}
console.log(y);// "1function"