When attempting to read a Json file using loadJSON from p5, I am encountering a delay in receiving the data. When I use
console.log(JSON.stringify(data))
, it displays {}
.
function setup() {
for(i = 0; i <= 3; i++) {
//Loading the JSON file
data = loadJSON('test'+ i +'.json');
//Processing the data
console.log(JSON.stringify(data);
}
}