Saturday, 12 May 2012

Javascript implied global

I wouldn't do this anyway but I have just read that

var a = b = 0;

would mean that b is made a global. Because of the right to left evaluation the b = 0 would be evaluated as an implied global. How fiendish....

I'm not sure what sort of person would do this though...

No comments:

Comments System

Disqus Shortname