how to remove the object property if the value is undefined js code example
Example: js remove undefined from object
Object.keys(obj).forEach(key => obj[key] === undefined && delete obj[key])
Object.keys(obj).forEach(key => obj[key] === undefined && delete obj[key])