News for hackers. Stuff that matters.
Re:Javascript patterns by rnd33 on Wednesday January 01, 2014 @08:11PM (#6997648)
I think I've been unclear. When I say function definition I'm referring to this:

    function foo() {
      console.log('bar');
    }
And when referring to a function expression I'm talking about this:

    var foo = function () {
      console.log('bar');
    };
The latter needs to be terminated with a semicolon to prevent ambiguity (in some situations), while the former does not. This for example is valid JavaScript:

    function foo() {
      console.log('bar');
    }foo=5
Re:Javascript patterns by ivanca on Wednesday January 01, 2014 @08:18PM (#6997673)
Yeah, that's correct; no discussion on that, and no linter that I have used asks you to put a semicolon in such case.