carlosbranco
4 months ago

Javascript calculate age from date small function

function calcAge(dateString) {
  var birthday = +new Date(dateString);
  return ~~((Date.now() - birthday) / (31557600000));
}
Do you have any comment on this tricks? then let the author know about that. comment here