string-reduce
Reduce a string to a value
Last updated 10 years ago by tjmehta .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install string-reduce 
SYNC missed versions from official npm registry.

string-reduce Build Status

Reduce a string to a value

Installation

npm i --save string-reduce

Usage

var reduce = require('string-reduce')

var sum = reduce('yolo', (sum, char) => {
  return sum + character.charCodeAt()
}, 0)
// sum: 451

var expectedSum = 0 +    
  'y'.charCodeAt(0) + // 121
  'o'.charCodeAt(0) + // 111
  'l'.charCodeAt(0) + // 108
  'o'.charCodeAt(0)   // 111
// expectedSum: 451

License

MIT

Current Tags

  • 1.0.0                                ...           latest (10 years ago)

1 Versions

  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE