Can someone please assist me in converting the JSON generated in Spring Boot into a JavaScript object array? I'm currently facing some difficulties.
https://i.stack.imgur.com/Tx5Ri.png
I've been using XMLHttpRequest and my JS code is as follows:
let evtArray = [];
var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState == 4 && request.status == 200){
var data = JSON.parse(request.response);
console.log(data);
evtArray = data;
}
}
request.open('GET', '/rest-view/events', true);
request.send();
Thank you,
Murilo