so i was checking @robbmj 's answer to this question, and i came across the following code:
var timer = duration, minutes, seconds;
and another one here:
var start = Date.now(),
diff,
minutes,
seconds;
I have never been to that code before. Could someone please explain what those two lines of code does or at least how to read them ?
var timer = duration, minutes = x, seconds = y;...minutesandsecondsis declared but w/o any initial valuesdiff,minutes, andsecondswill still beundefined. This can help makevardeclarations more obvious since you will have to worry about hoisting.varagain: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…var timer = duration; var minutes; var seconds;condensed a little,timeris set toduration,minutesandsecondsare undefined. Same thing applies to the second example, wherestartis defined as the value ofDate.now()and the other variables are "initialized"