I would like to know how to round up a year to the next World Cup year, like 2024 -> 2026, 2026->2026, or 2031 -> 2034
I really can’t figure out the formula, but I guess I should use the %
operator?
My attempt:
let worldCupYear;
const remain = thisYear % 4;
if(remain === 0){
worldCupYear = 2+ thisYear
}else if(remain != 2){
worldCupYear = remain + thisYear;
}else{
worldCupYear = thisYear;
}