how to use javascript Object.defineProperty

前端 未结 10 1220
不知归路
不知归路 2020-11-29 14:21

I looked around for how to use the Object.defineProperty method, but couldn\'t find anything decent.

Someone gave me this snippet of code:

Object.def         


        
10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 15:08

    Object.defineProperty() is a global function..Its not available inside the function which declares the object otherwise.You'll have to use it statically...

提交回复
热议问题