I have two array name and mark
I am trying to merge two arrays as one single object so that later I can iterate over. Like there is a table of two column the first return name from API such as A, b, c, d and so and second return marks such as 40, 50 55, 60 and so on. On receiving I am trying to make it as one iterable object as
finalOutput = [
0: {
A : 45
}
1: {
B: 55
}
2: {
C: 60
}
and so on...
]
I am trying to take the below approach which is not a complete solution. can you suggest me what approach I should take?
var name = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'I'];
var tName = name.split(',');
var mark = ['45', '55', '60', '65', '70', '75', '80', '85'];
var nameObj = Object.assign({}, tName );
console.log(nameObj);
var tMark = Object.assign({}, mark);
var finalOutput = [].concat(tName, tMark);
console.log('finalOutput', finalOutput);