JavaScript open brace in the same line

后端 未结 6 1567
心在旅途
心在旅途 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:50

    It's a myth. function blah() is always required to be followed by a expression block, so makes no difference which style you use. The first style is simply the most widely used form.

提交回复
热议问题