On Oct 18, 8:30 am, buda <www...@pochta.ru> 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 prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.