【文件属性】:
文件名称:getallpropertynames:获取原型链中的所有属性名称
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-12 15:43:02
JavaScript
获取所有属性名称
获取原型链中的所有属性名称
安装
npm install getallpropertynames --save
用法
import getAllPropertyNames from 'getallpropertynames' ;
class Foo {
foo ( ) { }
}
class Bar extends Foo {
bar ( ) { }
}
let bar = new Bar ( ) ;
getAllPropertyNames ( bar ) ;
// ['constructor', 'bar', 'foo', 'toString', 'toLocaleString',
// 'valueOf', 'hasOwnProperty', 'isPrototypeOf', ... ]
【文件预览】:
getallpropertynames-master
----.jshintrc(42B)
----src()
--------index.js(385B)
----.npmignore(30B)
----.travis.yml(68B)
----test()
--------index.js(496B)
----README.md(721B)
----.gitignore(31B)
----package.json(762B)