![]() ![]() If the two operands are of the same type and have the same value, then produces true and produces false. The good ones work the way you would expect. The prototype property is available if people want to inherit. In JavaScript, the Good Parts, Douglas Crockford wrote: JavaScript has two sets of equality operators: and, and their evil twins and. Good called DeSantis 'Americas Governor' when hosting him for breakfast at the Virginian Hotel in Downtown Lynchburg. When they want one, they call Xyz.create(), and get back a new, initialized object of my type. In a statement on Tuesday, Good said in part. the create() function is for users of my type. ![]() I return an object with a create() function, and a prototype property. This means I have a private space to work without making a mess in the global namespace. You can find his object creation function here: if (typeof Object.create != 'function') )(). However, JS is as it is so go and use "new". He (IMHO rightly) says that the way it turned out JS is conflicted, prototype based but with this one thing from "classical class" inheritance languages. I understand this particular statement to be more on an "academic" level, what SHOULD have been HAD the language been designed "right" and not with some leftovers of the class-based inheritance stuff. However, the YUI(3) team itself uses "new", and they DO follow his recommendations (since he's the Yahoo chief JS architect (UPDATE: he moved on, but the statement was true when this response was originally written). ![]() Crockford gives an example for an object creation function as should have been provided by JS itself in one of his Javascript talks available on ![]()
0 Comments
Leave a Reply. |