Object.create()– basic functionality works in all browsers. Non-IE browsers allow defining getters and setters. No browsers can define
writableon properties as this functionality isn’t available in today’s browsers.
Object.clone()– basic functionality works in all browsers.
Object.defineProperty()– same limitations as
Object.defineProperties()– same limitations as
Object.getPrototypeOf()– possibly inaccurate in IE due to lack of
Object.getOwnPropertyNames()– won’t return non-enumerable properties.
writableare always set to true. IE can’t retrieve getters and setters.
Object.keys()– works as expected.
Several of the static methods can’t be implemented using current technology, so I didn’t even bother trying. Therefore, the following six methods aren’t included:
You can download the source of my static object library along with some examples of usage here. The library isn’t recommended for production usage but may be useful if you want to play with the functionality to see what’s coming down the road. If you’d like to learn more about the static object methods, please refer to this document: Proposed ECMAScript 3.1 Static Object Functions: Use Cases and Rationale.