string-reduce
Reduce a string to a value
Last updated 9 years ago by tjmehta .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (9 years ago)

1 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |