0

Is there any efficient way of getting the number of days in current month using JavaScript ?

psyborg.eth
  • 310
  • 5
  • 18

1 Answers1

1

function _getDates(year, month) {
  return new Date(year, month, 0).getDate(); // 0 + number of days
}
console.log(_getDates(2016, 07))
brk
  • 48,835
  • 10
  • 56
  • 78