CodeGuide icon indicating copy to clipboard operation
CodeGuide copied to clipboard

javascript 中关于空行的规范

Open lovanya opened this issue 7 years ago • 0 comments

   // need blank line after blocks
   var obj = {
        foo: function() {
            return 1;
        },

        bar: function() {
            return 2;
        }
    };

   // not need blank line when in argument list, array, object
    var foo = {
        a: 2,
        b: function() {
            a++;
        },
        c: 3
    };

为什么第一个obj.foo 后面加空行,第二个foo.b后面又没有?

lovanya avatar Sep 21 '18 08:09 lovanya