Tuesday, July 2, 2013

An Instanceof learning ...see what I did there??

Hello!  Well today was mostly filled with wedding planning stuff, but I *did* manage to squeeze in some time to read my book (thanks again WonderS!!) and do a bit more on Codecademy.  Today I learned the JavaScript operator 'Instanceof '  The syntax goes:
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! 

Related Posts:

  • RubyMonk: More lessons in RubyHello!  Good news!! I passed my code challenge!!  This was their response: After reviewing your application, we think you might be a good … Read More
  • Raising, Exception, RescueAlthough I took a week off, don't think I'm done with Ruby!  I'm continuing on the RubyMonk: Ascent book.  As of late I've been learning abo… Read More
  • Like Pig Latin and Street LightsWell everyone I finally finished some Test Driven Development exercises tonight.  I did 14 in total.  They were not in any particular "chall… Read More
  • Submitted.Well, I've done it. I completed the Ruby track on Codecademy.  I've completed over 500 lessons and successfully submitted my code challenge to Ap… Read More
  • End of MonkHappy Saturday!! Well... sorta, I have to work most of today, but I'm getting a little coding in this morning.  This week I finished the RubyMonk… Read More

0 comments:

Post a Comment