I have an object that I loop with a for in loop that loops through the object to find the key and value.
house: {
john: {
love_off: "mary"
}
}
My for in loop returns:
for ( var key in house.john) {
house.john[key.replace("_off","") = house.john[key];
}
It returns a copy of the original array long with:
house: {
john: {
love: "mary"
love_off: "mary"
}
}
How do I just get "love": "mary" from the object and add it to array that needs to be returned?
love_offpair with the newlovepair?javascriptat Question. Is resulting object expected result? Are you trying to get the new property and value?