I created a function like this:
function saveItem(andClose = false) {
}
It works fine in Firefox
In IE it gives this error on the
Javascript does not allow a "default" specifier.
A quick way of doing what you would want is changing:
function saveItem(andClose = false) {
}
to the following:
function saveItem(andClose) {
// this line will check if the argument is undefined, null, or false
// if so set it to false, otherwise set it to it's original value
var andClose = andClose || false;
// now you can safely use andClose
if (andClose) {
// do something
}
}