Object.defineProperty for all browsers?

后端 未结 3 1182
青春惊慌失措
青春惊慌失措 2021-02-02 12:04

Asking about Object.defineProperty as demonstrated below:

function testComponent(){
    var testProperty;
    Object.defineProperty(this, \"testProperty\",
    {         


        
3条回答
  •  一生所求
    2021-02-02 12:45

    I've had this same question myself. (See here.) It doesn't look like it's fully possible in IE8 or lower. Otherwise the ES5 Shim is your best bet.

提交回复
热议问题