I have a JSON object structured like this.
const jsonData = {
"id": "6",
"name": "parent",
"path": "/",
"category": "folder",
"fid": "6",
"children": [
{
//details
},
{
//more details
}
]
}
What is the best way to iterate over this data and push it into a new array?
Declaration of array variable
getEntry: Array<Object> = []
Method to push object into an array
get addedEntry() {
let files = []
this.getEntry = files.push(this.jsonData)
}
However, I am encountering a type error. How can I successfully push this object into an array or convert it into an array?