I would like to know a simple way to increase the end of a variable with an incremental number, then check it later.
For example creating var using with a for loop or a different method
Example:
var example0=new Date(property.time);
var example1=new Date(property.time);
var example2=new Date(property.time);
var example3=new Date(property.time);
UPDATE
thanks for the answer, I don't know whether to open another discussion but I actually underestimated the question believing to solve my problem, in reality the situation is more complex, I explain myself better: I tried to use an array like:
let startArray =[];
let endArray =[];
for(i=0; i< 4; i++) {
for(j=1; j< 5; j++) {
startArray.push new Date(demoTracks[0].properties.time[i]);
endArray.push new Date(demoTracks[0].properties.time[j]);
}
}
// Get start/end times
var timelineData = new vis.DataSet([{start: startArray[i], end:
endArray[i],
content: 'Tracks' }]);
}
but for my distraction in writing (I thought I could solve this way) what I would need is to break start time from end time to get two separate fragments.
putting everything in an array and not getting the result because it cannot separate properties.time[0] from properties.time[1] which also need to be incremented separately. I show exactly what I need:
var startTime1 = new Date(demoTracks[0].properties.time[0]);
var endTime1 = new Date(demoTracks[0].properties.time[1]);
var startTime2 = new Date(demoTracks[0].properties.time[1]);
var endTime2 = new Date(demoTracks[0].properties.time[2]);
var startTime3 = new Date(demoTracks[0].properties.time[2]);
var endTime3 = new Date(demoTracks[0].properties.time[3]);
to then call in:
var timelineData = new vis.DataSet([{start: startTime, end: endTime,
content: 'Tracks' },
for this I meant as the question how to increase only the end of a variable (which is creating a problem for me) thanks again .