How can I extract the "title" values from this JSON array using JavaScript? I need to retrieve all the "title"s and store them in a new array like shown below:
array(
`hey title1`,
`hey title2`,
...
)
I am unsure of the number of titles we will receive, but I believe it can be achieved using a for loop.
{
data: [
{
id: '46475273517',
user_name: 'testtwo',
title: 'Hello this is my test for the eJx2',
is_set: true
},
{
id: '46471542013',
user_name: 'testone',
title: 'Hello this is my test for the eJx3',
is_set: false
},
{
id: '46474254233',
user_name: 'testthree',
title: 'Hello this is my test for the eJx7',
is_set: false
}
],
pagination: {
cursor: 'eyJiIjp7IkN1cnNvciI6ImV5SnpJam80TXpBeExqSTBNemcwTVRnME56WTVOQ3dpWkNJNlptRnNjMlVzSW5RaU9uUnlkV1Y5In0sImEiOnsiQ3Vyc29yIjoiZXlKeklqbzFOREV1T1RnMk56STNNall5TkRReE5Dd2laQ0k2Wm1Gc2MyVXNJblFpT25SeWRXVjkifX0'
}
}
Your assistance is greatly appreciated. Thank you!