JavaScript open brace in the same line

后端 未结 6 1566
心在旅途
心在旅途 2020-12-16 03:50

I remember there is a convention/recommendation to put opening brace in the same line, because of the way JavaScript adds a semicolon or something.

//OK
fun         


        
6条回答
  •  既然无缘
    2020-12-16 04:48

    This post on Elegant Code gives some explanation of automatic semicolon insertion, but in regard to returning objects, not declaring functions.

提交回复
热议问题