How would I get a loop in the array ? The code takes the current day and adds a x
value. For example, I would like it when Monday came where the script
document.getElementById("g").innerHTML = (dias[now.getDay() + 6] + ", " + [now.getDate () + 6] + " de " + meses [now.getMonth() ]);
(it will add on Monday plus 6 days), but it gives error, because there will only be another 5 days left in the array . So what I wanted was for him to create a loop .
var now = new Date();
var dias = ["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SABADO"];
var meses = ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT","NOV", "DEZ"];
document.getElementById("a").innerHTML = (dias[now.getDay()] + ", " + now.getDate () + " de " + meses [now.getMonth() ]);
document.getElementById("b").innerHTML = (dias[now.getDay() + 1] + ", " + [now.getDate () + 1] + " de " + meses [now.getMonth() ]);
document.getElementById("c").innerHTML = (dias[now.getDay() + 2] + ", " + [now.getDate () + 2] + " de " + meses [now.getMonth() ]);
document.getElementById("d").innerHTML = (dias[now.getDay() + 3] + ", " + [now.getDate () + 3] + " de " + meses [now.getMonth() ]);
document.getElementById("e").innerHTML = (dias[now.getDay() + 4] + ", " + [now.getDate () + 4] + " de " + meses [now.getMonth() ]);
document.getElementById("f").innerHTML = (dias[now.getDay() + 5] + ", " + [now.getDate () + 5] + " de " + meses [now.getMonth() ]);
document.getElementById("g").innerHTML = (dias[now.getDay() + 6] + ", " + [now.getDate () + 6] + " de " + meses [now.getMonth() ]);