Skip to content

stubObject

js
_.stubObject()

此方法返回一个新的空对象。

¥This method returns a new empty object.

新增于

¥Since

4.13.0

返回

¥Returns

(对象):返回新的空对象。

¥(Object): Returns the new empty object.

示例

¥Example

js
var objects = _.times(2, _.stubObject);

console.log(objects);
// => [{}, {}]

console.log(objects[0] === objects[1]);
// => false

Lodash v4.17 中文网 - 粤ICP备13048890号