fuse 28.1
Windows 10
I have a function that is updating a JSON. After the update gets done I what to save it on a file. But everything after the for loop is getting skiped.
I already try uno clean
and rea-starting the fuse project.
function initialPeriodTrackerJSONSetup(initD,periodL){ //deberiamos pasarle los paramatros del ultimo ciclo
var year = moment(initD).year();
var month = moment(initD).month();
var day = moment(initD).date();
// console.log("*****************************************");
// console.log(JSON.stringify(periodJSON.month[10]));
var tempDate = moment(initD);
for(var i = (month); i <= periodJSON.month.length;i++){ //--- this was the error <= should be <
periodJSON.month[i].year = tempDate.year();
periodJSON.month[i].periodDay = tempDate.date();
// console.log(tempDate.year()+" "+tempDate.month()+" "+tempDate.date());
// console.log(JSON.stringify(periodJSON.month[i]));
tempDate = tempDate.add(periodL,'day');
// console.log(JSON.stringify(periodJSON.month[10]));
} //--------------------------------------------------------------------- EVERYTHING AFTER THE FOR LOOP IS NOT GETTING HIT OR CALLED
console.log("*****************************************"); //<---------- this Line never gets called
// Storage.write("period_tracker.json", JSON.stringify(periodJSON))
// .then(function(succeeded) {
// if(succeeded) {
// console.log("Successfully wrote to file");
// }
// else {
// console.log("Couldn't write to file.");
// }
// });
}```
Already fixed the problem. Please close.
P.S. The debug windows never showed this error.