I use destructuring to declare some variables as follows:
const { a, b, c } = require('./something'),
{ e = 'default', f = 'default'} = c;
Is there a way to do this in one line? I tried something like:
const { a, b, c = { e = 'default', f = 'default'} } = require('./something');
But this gives me an error:
SyntaxError: Invalid short string property initializer
source
share