Week 2, Day 6
Today i began JavaScript Koans and reached test 77. While the majority of the work didn’t pose much of a challenge, i did stumble across the concept of the prototype chain. I don’t know that i’ll be any clearer in my explanation than the following extract from the MDN:
// Let's assume we have object o, with its own properties a and b: // {a: 1, b: 2} // o.[[Prototype]] has properties b and c: // {b: 3, c: 4} // Finally, o.[[Prototype]].[[Prototype]] is null. // This is the end of the prototype chain as null, // by definition, has no [[Prototype]]. // Thus, the full prototype chain looks like: // {a:1, b:2} ---> {b:3, c:4} ---> null console.log(o.a); // 1 // Is there an 'a' own property on o? Yes, and its value is 1. console.log(o.b); // 2 // Is there a 'b' own property on o? Yes, and its value is 2. // The prototype also has a 'b' property, but it's not visited. // This is called "property shadowing" console.log(o.c); // 4 // Is there a 'c' own property on o? No, check its prototype. // Is there a 'c' own property on o.[[Prototype]]? Yes, its value is 4. console.log(o.d); // undefined // Is there a 'd' own property on o? No, check its prototype. // Is there a 'd' own property on o.[[Prototype]]? No, check its prototype. // o.[[Prototype]].[[Prototype]] is null, stop searching, // no property found, return undefined
Towards the end of the night i began reading up on angularJS - a very popular javascript framework that everyone is going crazy over. My plan is to implement the ga-bank app as an angular app to get experience with the framework and see what the excitement is all about.
I have been using two main resources to study up on angularJS:
egghead.io
thinkster.io















