var start = stop = null;
Most people will respond, “define a variable called
start and a variable called
stop and then set them both to
null.” That is generally correct, but not specific enough. What actually happens is that a local variable called
start is defined and a global variable named
stop is defined; both are then set to
var operator applies to
start, not to
stop is part of the initialization (to the right of the equals sign). This code can be rewritten to create two local variables like this:
var start = null, stop = null;
var operator applies to both
Disclaimer: Any viewpoints and opinions expressed in this article are those of Nicholas C. Zakas and do not, in any way, reflect those of my employer, my colleagues, Wrox Publishing, O'Reilly Publishing, or anyone else. I speak only for myself, not for them.
Both comments and pings are currently closed.