Is this a problem with ASI or just the return grammar?

前端 未结 2 1931
一个人的身影
一个人的身影 2021-01-19 23:29

People often talk about JavaScript\'s nasty ASI (Automatic Semicolon Insertion), and often cite this example...

function a() {
    return [
        \'a\',
           


        
2条回答
  •  感情败类
    2021-01-19 23:43

    There's nothing in the spec that says a return value has to be on the same line as a return statement, it's just bad semi-colon insertion.

提交回复
热议问题