I am trying to get a 2d array using axios but when i console.log it it returns empty :/
My code:
let orig = []
axios
.get(<endpoint url here>)
.then(response => {
orig = response.data.activity_history
})
console.log('Orig -> ' + JSON.stringify(orig))
My endpoint is built to return data like this:
{
"id": 1,
...
"activity_history": [
[
"Test",
"Test",
"Test",
"Test",
"Test"
]
]
}
I'm trying to get the 2d array so I could push another array in it in the frontend, but when i console.log orig
it returns Orig -> []
. Any help?