function isValidMonth(month = 0) {
  // '01', '1', 1, '12', 12 are all ok
  // '12.0' is not ok, 12.0 is ok I guess
  return /^(0?[1-9]|1[0-2])$/.test(month.toString());
}
/**
 * Month represented by 1-based string or int is valid
 *
 * @param {String|Number} month
 */
Month represented by 1-based string or int is valid
@param {String|Number} month
Month represented by 1 - based string or int is valid @param { String|Number } month
function isValidMonth(month = 0) {
  return /^(0?[1-9]|1[0-2])$/.test(month.toString());
}
function isValidMonth ( month = 0 ) { return / ^(0?[1-9]|1[0-2])$ / . test ( month . toString ( ) ) ; }
Month represented by 1-based string or int is valid
 @param {String|Number} month
Month represented by 1 - based string or int is valid @param { String|Number } month
// '01', '1', 1, '12', 12 are all ok // '12.0' is not ok, 12.0 is ok I guess