Last updated 5 years ago
Was this helpful?
语法:
_.keysIn(object)
源代码链接:
npm包链接:
描述:
创建一个object自身 和 继承的可枚举属性名为数组。
object
注意:非对象的值会被强制转换为对象。
开始版本:3.0.0
参数:
object (Object): 要检索的对象。
object (Object)
返回值:
(Array): 返回包含属性名的数组。
(Array)
例子:
function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed)