Solution 1
Assuming I wanted to call Date.toLocaleTimeString()
dateObj.toLocaleTimeString(locales, options)
To pass in options
without locales
const date = new Date()var options = { timeStyle: 'full' }date.toLocaleTimeString(undefined, options)
Solution 2
function test(options) { console.log(options.a, options.b, options.c)}
test({b: 'b', c: 'c'}) // undefined "b" "c"
Solution 3
function test({a, b, c}={}) { console.log(a, b, c)}
NOTE: Require ES6 / ES2015
test({b: 'b', c: 'c'}) // undefined "b" "c"