Day 6: Morning Review – “The Principles of Object-Oriented JavaScript” by Nicholas C. Zakas

How I’m Studying JavaScript

I’ve decided on a pattern of study for my JavaScript endeavours.

  1. Progress through Eloquent JavaScript chapters (as best as you can)
  2. Watch & follow Youtube tutorials on a JS framework (currently AngularJS)
  3. At night, read a JS book intended a bit above the beginners level

Step 1 is great for diving into heavy JavaScript ideas and then attempting to apply those ideas in the exercises (even if it’s with great difficulty). Step 2 is because I believe that familiarity and continued exposure breeds confidence in some measure, and even if I don’t completely understand what I’m watching or doing with AngularJS, when I eventually dive into that world it will at least make a little bit more sense than if I hadn’t immersed myself in that world/it’s language.

Step 3 is something I commenced last night, and I think to great effect. I started reading ‘The Principles of Object-Oriented JavaScript’ by Nicholas C. Zakas

It was written by a former front-end engineer of Yahoo, and it’s working a treat for me right now as a tool for reviewing/consolidating little bits and pieces that I haven’t yet embedded into my skull from Eloquent JavaScript. For example:

Bits & Pieces Of My JavaScript Study Consolidation

  • I now remember what hoisting is, and that this happens for function declarations not expressions.
  • Many things in JavaScript are objects and remembering this is key to understanding how things work (for example, the reason you can’t declare two functions with the same name in the same scope and expect both to execute. Trick: think of what the code would look like if the function declarations were written as function expressions instead).
  • Remembering about the ‘arguments’ variable available in a function internally, and JS’s lax attitude to limits on parameters/arguments being passed into a function, regardless of explicitly defined parameters.
  • typeofinstanceof checking and the perils of trying to use some of these on Arrays (.isArray is the secret) and null checking (it’s an object, so requires strict comparison operators ===).
  • I also started learning about this. No, I actually mean ‘this‘, a kind of object that’s available and useful when functions declared inside object property values (i.e methods) reference the object variable. Future changes to the variable name need to be reflected inside the function/method, and ‘this‘ apparently provides a way to do it (I still need to actually write code to reinforce this idea, but I definitely appreciated the introduction to it).

Now I have to take care of some real world/boring stuff, then it’s gym/dinner/CODE. Who knew that learning could be so interesting.

*Note to self: need to review how to test for NaN.

JavaScript freshman signing out.. again!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s