Cannot assign to read only property 'name' of object '[object Object]'

后端 未结 6 1517
攒了一身酷
攒了一身酷 2021-02-04 03:19

The following code will throw an error only for the name property. It could be fixed by specifying name property as writable in Object.create

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 03:57

    The name is reserved property of Function object to which you are trying to set it in. You cannot set it.

    documentation for name property is at MDN.

提交回复
热议问题