Asv3's Blog

September 26, 2009

Prototype Chains

Filed under: front-end, javascript — Tags: , , , , , , — asv3 @ 10:27 pm

Whenever you try to access some property of a JavaScript object, it will look for that property in 2 places. First one is Object itself and second one is Object’s prototype. If prototype of that Object is another Object then search moves on that Object and that Object’s prototype. Search like this carried till it reach that accessed property to return value or native JavaScript Object, of which prototype is nothing but null and returns null. this feature of JavaScript is called as Prototype Chains

Blog at WordPress.com.