News for hackers. Stuff that matters.
Re:An Object is not a Hash by alanh on Tuesday October 09, 2012 @12:54AM (#4630025)
I think you are missing something.

If I understood the article’s example, he’s suggesting the (perfectly plausible) use case of a new blog post named, e.g., `hasOwnProperty`. Then they would want to set a key named `hasOwnProperty` in the `posts` object, but `hasOwnProperty` is already defined (via inheritance, since all objects have it) as a function (well, native code)… so now you have either (a) prevented your blog from allowing a reasonable blog post title, or (b) seriously mucked up your blog by accepting a blog post title that has the side effect of redefining a basic object method.

The author is not confused.

There are no comments on this comment yet.