{
"StudentId": 1,
"subject": "FUNDAMENTALS OF INFORMATION TECHNOLOGY",
"marks": 17
},
{
"StudentId": 2,
"subject": "FUNDAMENTALS OF INFORMATION TECHNOLOGY",
"marks": 25
},
{
"StudentId": 1,
"subject": "COMPUTER ORGANIZATION",
"marks": 10
},
{
"StudentId": 2,
"subject": "COMPUTER ORGANIZATION",
"marks": 15
},
{
"StudentId": 1,
"subject": "ENGLISH",
"marks": 10
},
{
"StudentId": 2,
"subject": "ENGLISH",
"marks": 15
},
{
"StudentId": 1,
"subject": "LAB BASED ON C",
"marks": 10
},
{
"StudentId": 2,
"subject": "LAB BASED ON C",
"marks": 15
}
]
}
var array2={
"MarksList": [
{
"StudentId": 1,
"subject": "FUNDAMENTALS OF INFORMATION TECHNOLOGY",
"marks": 17,
"subject": "COMPUTER ORGANIZATION",
"marks": 25,
"subject": "ENGLISH",
"marks": 20
},
{
"StudentId": 1,
"subject": "FUNDAMENTALS OF INFORMATION TECHNOLOGY",
"marks": 17,
"subject": "COMPUTER ORGANIZATION",
"marks": 25,
"subject": "ENGLISH",
"marks": 20
}
]
}
Guys, How can I convert that array1 to array2?
array1.map()
Another question: Are you sure that js object can have identical properties?
You cannot convert array1 to array2.
Обсуждают сегодня