How do I create a new array from another array
my array is data1
this.state = {
data1: [
{'x':'%20', 'y':11, 'z':'sunday'},
{'x':'%30', 'y':21, 'z':'monday'},
{'x':'%40', 'y':31, 'z':'tuesday'}
],
data2: [],
}
and i want to create data2, that look like this
data2: [
{'x':'%20-(11)-sunday'},
{'x':'%30-(21)-monday'},
{'x':'%40-(31)-tuesday'}
]