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
}
}
In my opinion, the best way to use ES2015 features is to bundle assets with Browserify or WebPack, with a step for using Babel to trans-compile ES2015 to ES5. That way you don't have to worry about that ES2015 browser compatibility chart. It's a pain to get started the first time, but worth it.