Object.keys VS Object.getOwnPropertyNames

Jürg Lehni lists at scratchdisk.com
Sun Apr 18 07:35:50 PDT 2010


I am aware that these function names are probably set in stone by now, but am curious to hear the reasons for their naming, as there seem to be many discrepancies in there, mostly:

- The use of both 'key' and 'name' for the same thing
- The omitting of 'get' in Object.keys

In terms of a clean API, something along these lines would have seemed more consistent:

Object.getKeys
Object.getOwnKeys

As I am new to the community process of EcmaScript but strongly involved with the language for soon 10 years through projects like Scriptographer.org and Helma.org, and therefore concerned with the language's future, I am curious to find out more about these processes of the defining of the language's API and syntax.

Jürg


More information about the es-discuss mailing list