On Stackers' recommendation, I have been reading Crockford's excellent Javascript: The Good Parts.
It's a great book, but since so much of it is devoted to describing the best way to use Javascript's basic functionality, I'm not sure how I can put his advice into practice without duplicating the efforts of many other Javascript programmers.
Take this passage, for example:
When you make a new object, you can select the object that should be its prototype. The mechanism that Javascript provides to do this is messy and complex, but it can be significantly simplified. We will add a
create
method to theObject
function. Thecreate
method creates a new object that uses an old object as its prototype.if (typeof Object.create !== 'function') { Object.create = function(o) { var F = function () {}; F.prototype = o; return new F(); }
I could manually add this code to all my Javascript projects, but keeping track of everything would be a huge pain.
Are there any libraries that implement The Good Part's recommendations and thereby save me the trouble of having to keep track of them (/ physically type them all out)?