truncate-to-multiple
v0.0.0
Published
Truncate an array to the highest multiple of a number
Downloads
33
Readme
truncate-to-multiple
Truncate an array to the highest multiple of a number
Installation
npm install truncate-to-multiple --save
Usage
var truncateToMultiple = require('truncate-to-multiple')
console.log(truncateToMultiple([ 1, 2, 3, 4, 5, 6, 7, 8 ], 3))
// -> [ 1, 2, 3, 4, 5, 6 ]
var truncatedArray = truncateToMultiple(array, multiple)
Options must include:
array
- an array to be truncatedmultiple
- a multiple to truncate by