开发者

What a strange error in JS formatting of a new object?

开发者_开发知识库My javascript code that produces a syntax error:

var x =
{
  a: 123
};

The same code without an error:

var x = {
  a: 123
};

What the heck?


Javascript adds implicit ";" at the end of lines sometimes, I suppose this is what happens, and results in

var x = ;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜