has-own-prop:更安全的.hasOwnProperty()

时间:2021-05-26 08:02:12
【文件属性】:
文件名称:has-own-prop:更安全的.hasOwnProperty()
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-26 08:02:12
JavaScript 有自己的财产 更安全的.hasOwnProperty() Object.prototype.hasOwnProperty.call(object, property)快捷方式。 您不应该使用.hasOwnProperty()因为它上将不存在,或者它可能已被覆盖。 安装 $ npm install has-own-prop 用法 const hasOwnProp = require ( 'has-own-prop' ) ; const object = Object . create ( null ) ; object . unicorn = true ; object . hasOwnProperty ( 'unicorn' ) ; //=> 'TypeError: undefined is not a function' hasOwnProp ( object , 'unicor
【文件预览】:
has-own-prop-main
----index.js(141B)
----test.js(160B)
----package.json(538B)
----index.test-d.ts(215B)
----readme.md(597B)
----.github()
--------workflows()
----license(1KB)
----index.d.ts(323B)
----.gitignore(23B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitattributes(19B)

网友评论