Simply use this code that Square
is initialized or not
object1.hasOwnProperty('width');
return true if Square
has been loaded/initialized otherwise return false.
OR
If you want to do it by method then use.
var object1 = new Square();
object1.onload(); //call this method for check loaded or not