Write a function that should take an array of objects and it should replace a particular value of the key?
for example: in below object, all the value of "bar" should be replaced to "foo-bar"
let obj = {
a: "foo",
b: "bar",
c: {
d: "foo",
e: "bar",
f: {
g: "test",
h: "bar",
}
}
}
Note: All the nested object properties also needs to be replaced