Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually, if you consider the return example in the blog, you do need to learn some caveats and rules. That's the point.


No because you still have to remember that rule whether you use semicolons everywhere or not.


Anyone who would write return\n deserves all they get.

It's a fun example, but it would never happen in real life.


    function getCount()
    {
        return 
        {
            'count': 1
        };
    }
Not what I'd do, but a common style nonetheless.


It's also completely valid JavaScript that does something very different than what it appears to.

    function getCount () {
      return undefined
      { // open code block
        'count': /*labelled line*/  1  //numeric expression
      } // close code block
    } // close function
LINE BREAKS CONSIDERED HARMFUL.


Which is why I'd say if you're writing javascript, use { brackets properly, and ; properly.

I agree, it's a common style, but a horrible one IMHO.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: