let options = {
title: 'My menu',
items: ['item1', 'item2']
};
function showMenu({
title = 'Untitled',
width: w = 100,
height: h = 200,
items: [item1, item2] = ['something', 'esle'] // default whole array
/*
items: [item1 = 'something', item2 = 'else'] // default items
*/
} = {} /* default empty obj if showMenu() doesn't get an argument */ ) {
console.log(`${title} ${w} ${h}`);
console.log(`${item1} and ${item2}`);
}
showMenu(options);