JavaScript Code Refactoring

Haebin Ethan Jeong·2020년 7월 21일
0

Objective: To write a function that calculates your age.

My Original Code:

  • Very intuitive and easy to follow, but long.

Refactored code:

  • converting the date to miliseconds using .getTime().
  • Very short, but can't calculate the age before 1970.
profile
I'm a Junior studying Economics and Computer Science at Vanderbilt University.

0개의 댓글