code: function isValid(year, month, date) {
          if (date < 1) {
              return false;
          }
  
          if (month === 1 && date > 28) {
              return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);
          }
  
          if (month === 3 || month === 5 || month === 8 || month === 10) {
              return date < 31;
          }
  
          return true;
      }
docs: Check if date is valid for specific month (and year for February). Month: 0 = Jan, 1 = Feb, etc