var currentDate = new Date(); while(currentDate.getFullYear() < 2016) { if(currentDate.getDay() == 5) console.log( currentDate ); currentDate.setDate(currentDate.getDate() + 1); }