object instanceof constructor
Basically it is used as a test to see if the object you have created is truly an instance of a prior constructor. For example, if you had just made a constructor Car, and now you wanted to make a constructor electricCar you could use the notation:
ElectricCar.prototype = new Car ();
then you could use instanceof to test if ElectricCar had inherited all the atributes of Car. :D Pretty awesome, huh? Well that's all for me today!
0 comments:
Post a Comment