Acme.BookStore.HttpApi.Host/node_modules/object.reduce/README.md
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
# object.reduce [](https://www.npmjs.com/package/object.reduce) [](https://npmjs.org/package/object.reduce) [](https://travis-ci.org/jonschlinkert/object.reduce)
> Reduces an object to a value that is the accumulated result of running each property in the object through a callback.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save object.reduce
```
Install with [yarn](https://yarnpkg.com):
```sh
$ yarn add object.reduce
```
Install with [bower](https://bower.io/)
```sh
$ bower install object.reduce --save
```
## Usage
the initial value (or value from the previous callback call), the `value` of the current property, the `key` of the current property, and the `object` over which the function is iterating. Node.js/JavaScript utility.)_
**Params**
* `object` **{Object}**: The object to iterate over (the iteratee)
* `fn` **{Function}**: The function invoked per iteration.
* `init` **{Object}**: The initial value to use for the accumulator.
* `thisArg` **{Object}**: (optional) Object to use as the invocation context for the iterator (expose as `this` inside the iterator)
Executes the given callback `fn` once for each own enumerable property in the object. The callback receives the following arguments:
* `acc`: the initial value (or value from the previous callback call),
* `value`: the of the current property,
* `key`: the of the current property, and
* the original `object` over which the function is iterating.
**Example**
```js
var reduce = require('object.reduce');
var a = {a: 'foo', b: 'bar', c: 'baz'};
reduce(a, function(acc, value, key, obj) {
acc[key] = value.toUpperCase();
return acc;
}, {});
//=> {a: 'FOO', b: 'BAR', c: 'BAZ'};
```
## About
### Contributing
后面还有 35 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
