For example I have a JSON data like
olddata = {
userNname : "joeydash",
sex : "female",
email : "[email protected]"
};
dataToEdit = {
name = "Mritunjoy Das",
sex = "male"
};
Is there any function in javascript such that if i do
newData = doSomething(oldData,dataToEdit);
console.log(newData);
it shows
{
userNname : "joeydash",
name : "Mritunjoy Das"
sex : "male",
email : "[email protected]"
}