Answers for "typescript add property if not exist, merge if it exists"

1

typescript add property if not exist, merge if it exists

Object.keys(obj2).forEach(function(key) {
    if (key in obj1) { // or obj1.hasOwnProperty(key)
        obj1[key] = obj2[key];
    }
});
Posted by: Guest on October-08-2020

Code answers related to "typescript add property if not exist, merge if it exists"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language