Here's the code, it's pretty simple:
(function() {
"use strict";
// Define our constructor
this.White = function() {
this.version = "1.0.0";
};
}());
// Later
a = new White();
alert(a.version);
In JSBin (and when running JShint), it works like it should. Doesn't work in JSBin after adding "use strict"
. When running this script in Chrome, however, I get this vague message:
Uncaught TypeError: Cannot set property 'White' of undefined