I have data array object and two arrays scoreData and titleData as follows
scoreData=[]
titleData = []
data = [
{score:1, title: tesh},
{score:2, title: teshu},
{score:3, title: teshiti} ]
I Wanted to push score and title values into scoreData and titleData respectively.
So the expected output will be
scoreData = [1,2,3]
titleData = [tesh,teshu,teshiti]
Thanks
>Solution :
scoreData = data.map(({score}) => score);
titleData = data.map(({title}) => title);