Michael Howell
Member since Aug 31, 2011
- Profile: /members/8907-michael-howell.htm
- Comments: 2
Recent Blog Comments By Michael Howell
-
Javascript's hasOwnProperty() Method Is More Consistent Than The IN Operator
Posted on Aug 31, 2011 at 1:42 PM
@Drew You are right of course. The problem is that when you try to make js work like a conventional class-based inheritance language you have to use its slower constructs. What I do is do a typeof == string to see if I don't know the name (ie I need to look at the object members ) then look to the ... read more »
-
Javascript's hasOwnProperty() Method Is More Consistent Than The IN Operator
Posted on Aug 31, 2011 at 10:33 AM
What I have found is that hasOwnProperty is excellent in most cases but if you use a javascript class library such as John Resig's or JavascriptMVC's and you want to callback a method laying inside the parent class you'll need to use the IN keyword because as you have explained prototype inheritance... read more »