Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

mapping: function (mappingObj,searchMap=false) {
// code 
}

Error is : Expected ')'

like image 831
Kiran Avatar asked Jul 18 '16 06:07

Kiran


1 Answers

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;
}
like image 121
choz Avatar answered Sep 16 '22 22:09

choz