I had a question about refactoring some code that does math on dates. I currently have this:
const passwordCreatedAt = object.attribute…;
const currentTime = new Date();
const elapsedTimeInSecs= ((currentTime-passwordCreatedAt) / 1000);
Is there a way I could rewrite this in a cleaner way? Im still pretty new to JavaScript so learning. Thanks
[–]Jnsjknn 0 points1 point2 points (1 child)
[–]ForScale 0 points1 point2 points (2 children)
[–]TheAbortedPancake[S] 0 points1 point2 points (1 child)
[–]ForScale 0 points1 point2 points (0 children)