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:

  • The color RedSaturday night I received my code challenge from App Academy!  It's not a JavaScript challenge and so I'll be setting aside JS for a couple days … Read More
  • Teachers and ToolsOver the weekend I was still really struggling with the Blackjack game.  I was soooo frustrated because 1) it was working and 2) I didn't know wh… 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
  • 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 Wonder… Read More
  • Coding, Wedding, Coding, App Academy!!My day has been a bit crazy!  I did some coding this morning, worked on some wedding stuff, did a bit more coding... tried to read my book but go… Read More

0 comments:

Post a Comment