Obtenga el número de días en un mes JavaScript

function getDaysInMonth(year, month) {
  return new Date(year, month, 0).getDate();
}
kid amogus