const a = 1;
const b = undefined;
const c = { a, b }
{ a:1, b:undefined }
function fillDefined(obj) {
return Object
.entries(obj)
.reduce((obj, cur) => {
if (typeof cur[1] !== 'undefined')
obj[cur[0]] = cur[1] ;
return obj;
} , {})
}
const a = 1;
const b = undefined;
const c = fillDefined({ a, b })