Use the do...while method to enter all Sundays of a month (instance code)
do{ var date = Number(prompt('Please enter the total number of days in one month')); var start = (prompt('Please enter the week of the first day of a month')); for(var i=0;i<date;i++){ if((start+1)%7===0){ console.log(i+' sign is Sunday') }} console.log('Query finished');}while('yes'===prompt('Do you still continue to query for rest days?','yes continue to end otherwise')); console.log('Query end');The above article using do...while method input all Sundays (example codes) in a month is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.