Object.defineProperty in ES5?

前端 未结 3 2030
青春惊慌失措
青春惊慌失措 2020-11-28 14:54

I\'m seeing posts about a \'new\' Object.create that makes enumeration configurable. However, it relies on a Object.defineProperty method. I can\'t find a cross browser im

3条回答
  •  再見小時候
    2020-11-28 15:08

    If you want a good defineProperty() implementation, take a look at https://github.com/kriskowal/es5-shim

    Unfortunately, you cannot make enumeration configurable in an ES3 environment. This shim will let you call the API in either environment, but the properties will still be enumerable under ES3.

提交回复
热议问题