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

后端 未结 2 797
鱼传尺愫
鱼传尺愫 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条回答
  •  Happy的楠姐
    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;
    }
    

提交回复
热议问题