Is it possible to update only the existing property values of an object without adding new properties from another object?
Here is my example.
form = {name: '',email: ''};
data = {name: 'sample', email: '[email protected]', datofbirth: '6/2/1990' };
form = {...form, ...data};
console.log(form);
Result:
{"name":"sample","email":"[email protected]","datofbirth":"6/2/1990"}
Expected Result:
{"name":"sample","email":"[email protected]"}
I dont want the dateofbirth or any new property added on my form object.