[JSMentors] Re: Best approach to OOP in JavaScript

2011-09-27 Thread Jarek Foksa
According to this benchmark Object.create() is ~10 times slower than constructor functions on Chrome: http://jsperf.com/object-create-vs-crockford-vs-jorge-vs-constructor/26 Will an average app written with Object.create() be noticeably slower than the same app implemented with constructor functio

[JSMentors] Re: Best approach to OOP in JavaScript

2011-09-27 Thread Jarek Foksa
How about this code, it uses Object.extend() instead of __proto__ for creating inheritance chain as described here: http://yehudakatz.com/2011/08/12/understanding-prototypes-in-javascript/ Looks pretty clean, though I'm not sure whether iterating over object properties won't slow down the code. Co