3 ms·
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., `h
by alanh 14y ago
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.