In addition to what Allen said, you could also do something like this:
function setCookie(name, value, { secure, path, domain, expires } =
cookieDefaults) { }
where `cookieDefaults` is defined elsewhere.
Or you could do something like:
function setCookie(name, value, { secure = false, path = ".", domain =
"", expires = now() } = {}) { }
where you are specifying default initializers within the destructuring
pattern.
Kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss