Merge objects in JavaScript

Viewed 125

I have two objects and I want to merge them, but it should not replace the object.

var x = {'one':1, 'two': {'b': 2, 'c': 3}}
var y = {'two': {'b': 4}}

When I merge them The out put should be :

{'one':1, 'two': {'b': 4, 'c': 3}}
1 Answers
Related