T.J. what the reasons not to make them Object.prtototype methods? On 18 окт, 14:21, "T.J. Crowder" <[email protected]> wrote: > On Oct 18, 8:30 am, buda <[email protected]> wrote: > > > I try > > > var o = {}; > > o.name = 'propertyName'; > > alert(o.keys); --> undefined > > > why? but in debugger I see that Object has all methods, but o - not! > > `keys` is not an instance method, it's a method of the `Object` > function: > > alert(Object.keys(o)); // "name" > > You're confusing `Object` with `Object.prototype`. The properties of > `Object` are not inherited by object instances; the properties of > `Object.prototype` are. > -- > T.J. Crowder > Independent Software Engineer > tj / crowder software / com > www / crowder software / com
-- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
