function sum(value, size) {
size = size || 1;
return value * size
}
console.log(sum(3)); //3
function sum(value, size=1) {
return value * size
}
console.log(sum(3)); //3
function sum(value, size={value:1}) {
return value * size.value
}
console.log(sum(3)); //3
console.log(sum(3, {value:3})); //9