Split up an integer into even parts that add to the original integer.
npm install split-integer
const splitInteger = require("split-integer")
splitInteger(10, 2)
//=> [5, 5]
splitInteger(10, 3)
//=> [4, 3, 3]
splitInteger(10, 3, { smallestFirst: true })
//=> [3, 3, 4]
Type: number
The number to split.
Type: number
The amount of parts to split the number into.
Type: object
Type: boolean
Default: false
Whether to order the smallest numbers first in the resulting array.