i have this object:
const memorized = [
{
verses: [1, 2, 3, 4, 5],
when: '2022 Jan 14'
},
{
verses: [6, 7, 8, 9]
when: '2022 Jan 15'
},
{
verses: [10, 11, 12, 13, 14, 15]
when: '2022 Jan 16'
},
...
]
and how can i get the total verses like this:
const total_verses = [1, 2, 3, 4, 5, ..., 15]
My possible solution would be:
let total_verses = []
memorized.map(ar => total_verses.push(...ar.verses))
But i would like to do it by just filtering or mapping.
Thanks in advance!