How to fix the jslint message: variable is already defined

后端 未结 2 1628
礼貌的吻别
礼貌的吻别 2021-01-22 05:00

I was trying to implement the following code:

var action = function (e) {     
    if (!e) {
        var e = window.event;
    }
    e.cancelBubble = true;
    i         


        
2条回答
  •  孤街浪徒
    2021-01-22 05:14

    In the function, actually e has been defined as argument. so when you define some variable same as arguments, it will complains.

提交回复
热议问题