Expected ')' JS error in IE after assigning a value to a function argument

后端 未结 2 798
鱼传尺愫
鱼传尺愫 2021-02-07 11:49

I wrote the below code in my JS file and IE is giving error for the argument \'searchMap\' when I am assigning value for it in the function.

map         


        
相关标签:
2条回答
  • 2021-02-07 12:14
    var searchMap = false;
    mapping: function(mappingObj, searchMap) {
        // code
    }
    
    mapping(mappingObj, searchMap);
    
    0 讨论(0)
  • 2021-02-07 12:23

    You are using default parameter. It is a feature of ES6, and IE does not support this.

    I would suggest to convert your code to ES5, like..

    mapping: function (mappingObj, searchMap) {
       if (!searchMap) searchMap = false;
    }
    
    0 讨论(0)
提交回复
热议问题