How to do recursion with a large nesting of objects?

Problem:
Sometimes it can come in a large Qty. of the data, and can continue to go to objects, I do not understand how to properly process them recursively:
"extra_data":{
 "city": {"type":"h","value":"Samara","fias_id":"bb035cc3-1dc2-4627-9d25-a1bf2d4b936b","full_type":"gored","value_with_type":" g Samara"},
 "region": {"code":"63","type":"all","value":"Samarskaya","fias_id":"df3d7359-afa9-4aaa-8ff9-197e73906b1c","full_type":"oblast","value_with_type":" Samara obl"}
}


Stack:
vue.js

My codewhich gives me 2 times and on 1 of the properties is not.
Use in the methods
setExtraFields() {
 let a = []
 _.forEach(this.lead.extra_data, (val, key) => {
getProp(this.lead.extra_data)
})

 function getProp(o) {
 for(var prop in o) {
 if(typeof(o[prop]) === 'object') {
getProp(o[prop])
 } else {
 let rusTitle = cyrillicToTranslit().reverse(prop)
 let obj = {"title": rusTitle, "value": o[prop]}
 // here I want to throw in an array of objects, which then will use v for
 return a.push(obj)
}
}
}
console.log(a)
}

<b>console</b>
0: {title: "the typ", value: "g"}
1: {title: "soda", value: "63"}
2: {title: "the typ", value: "g"}
3: {title: "soda", value: "63"}
April 3rd 20 at 18:41
1 answer
April 3rd 20 at 18:43
Solution
Here is a working function that loops through the objects and fold them correctly into a single array:
let a = []
getProp(this.n)
 function getProp(data) {
 let obj = {}
 _.forEach(data, (val, key) => {
 if (_.isObject(val)) {
getProp(val);
 } else {
 a.push({"title": key, "value": val})
}
})
 }

Find more questions by tags JavaScriptVue.js