Getting a JSLint warning concerning labels in Javascript

后端 未结 3 2003
余生分开走
余生分开走 2021-01-19 07:55

In my javascript I have this

    loopDeLoop:
        while (foo !== bar) {
            switch (fubar) {
                case reallyFubar:
                            


        
3条回答
  •  不要未来只要你来
    2021-01-19 08:08

    You are using the label correctly.

    JSLint is throwing a warning because labels in Javascript are horribly bad style, and JSLint wants you to know that.

    To reiterate, if you use labels at all, even correctly, JSLint will give that warning.

    Edit: Looks like you might be able to disable the label warning with a -use_of_label configuration directive.

提交回复
热议问题