I have an output like below:
output = {
"New Classroom": [{
"Name": "Apple",
"Age": "6",
"Percentage": "24.00%"
}, {
"Name": "Orange",
"Age": "5",
"Percentage": "9.88%"
}, {
"Name": "Green",
"Age": "2",
"Percentage": "27.27%"
}, {
"Name": "Grey",
"Age": "6",
"Percentage": "12.63%"
}]
}
How do I replace New Classroom
with NewClassroom
and the New classroom is not always a "NewClassroom".It may be different text
ob = JSON.parse(output);
alert(Object.keys(ob))
when I do this, I'm getting Newclassroom
as the key
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…