JavaScript curly braces with no function or json

后端 未结 6 810
别那么骄傲
别那么骄傲 2020-12-06 16:16

Just opened a client\'s javascript file and the first lines are along the lines of this:

{
    var s_account=\"blog\";
}

Which I don\'t get

6条回答
  •  粉色の甜心
    2020-12-06 16:54

    Quick addition. In some IDE like Visual Code, putting Curly Braces will actually create a visual block with a 'drop-down' arrow, allowing you to completely hide a portion of code with just a click. It helps with code organization. I'm using it when creating HTML element with a lot of CSS. Since it does not affect code execution, this is very useful.

提交回复
热议问题