mjanssen / pickaround

A small utility to pick numbers around a given number, with a given range

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pickaround(num, range)

A tiny utility to pick numbers around a given number, based on a given range.

Usage

pickaround(number, range, [negative])

pickAround(8, 5) === [6, 7, 8, 9, 10];

pickAround(1, 5) === [-1, 0, 1, 2, 3];

pickAround(1, 5, false) === [0, 1, 2, 3];

Licence

MIT

About

A small utility to pick numbers around a given number, with a given range

License:MIT License


Languages

Language:JavaScript 100.0%