A student asked me why JavaScript requires semicolons after variable declarations but not after function declarations and I didn't really have a good answer.
For example, these variable declarations (including the one holding a function) are followed by semicolons...
var x = 5;
var test = function() { return null; };
But this function declaration has no semicolon afterwards nor should it. Why? What is the logic behind the differentiation? Why does variable assignment require a semicolon but function declaration does not?
function test {
return null;
}