Working around IE8's broken Object.defineProperty implementation

后端 未结 5 1202
一向
一向 2020-12-05 03:14

Consider the following code, using ECMAScript5\'s Object.defineProperty feature:

var sayHi = function(){ alert(\'hi\'); };
var defineProperty =          


        
5条回答
  •  爱一瞬间的悲伤
    2020-12-05 03:23

    I'm using Browserify with the package pluralize from npm which uses Object.defineProperty and I dropped this in.

    https://github.com/inexorabletash/polyfill/blob/master/es5.js

提交回复
热议问题