Please explain this usage of a colon in javascript

前端 未结 5 442

I\'m making a library, and I often inspect the result of Closure Compiler\'s output to see how it\'s doing things (I do have unit tests, but I still like to see the compiled

5条回答
  •  猫巷女王i
    2021-01-11 12:41

    It is a label

    Provides a statement with an identifier that you can refer to using a break or continue statement.

    For example, you can use a label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution.

    Another common place you see it is when people stick the wonderful and useless javascript: on event handlers.

提交回复
热议问题