js advanced (proxy, shallow copy, deep copy, throttling and anti-shake, closure.hasOwnProperty)

1.Agent 1. Question: How to define an object that will not be modified or traversed? Define default properties through Object.defineProperty(object, property name, option) cannot be modified cannot be deleted cannot be traversed Note: The value passed in by Object.Property and the value returned are the same address You can configure the properties value: initial value […]

[Solved] TS uses the hasOwnProperty method to report an error

Determine whether the obj object contains the children property, but the following error occurs Do not access Object.prototype method ‘hasOwnProperty’ from target object. Cannot directly access methods on Object prototype Reason: It is not safe to call hasOwnProperty directly on the result object. If the obj object itself has a hasOwnProperty property, there will be […]

[Solved] Solve the error: Do not access Object.prototype method ‘hasOwnProperty’ from target object no

An error occurs: You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file. ERROR in [eslint] E:\project\todolist\src\components\MyItem.vue 36:19 error Do not access Object.prototype method ‘hasOwnProperty’ from target object no-prototype-builtins ? 1 problem (1 error, 0 warnings) webpack […]