var dayName = ‘вторник’;
var numDay = 15;
var dayNames = [‘понедельник’,‘вторник’, ‘среда’, ‘четверг’, ‘пятница’, ‘суббота’, ‘воскресенье’];
var getDayOfWeek = function(dayName, numDay){
var iDay = dayNames.indexOf(dayName)
for (var j = 1; j < numDay;j++, iDay++ ){
if(iDay == 6){
console.log(iDay)
iDay=-1
}
}
return dayNames[iDay]
}