@writetome51/in-numeric-order
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

inNumericOrder(numbers): boolean

If numbers are in ascending order, returns true.
Each item in numbers must be of type 'number'.

Examples

inNumericOrder([1,2,3,4]); // --> true

inNumericOrder([-1.03, -1.02, 0.222, 0.223]); // --> true

inNumericOrder([-10, 5, -11]); // --> false

inNumericOrder([-10, '', -11]);
// --> Error: "Input must be a finite number of type 'number'"

Installation

npm i @writetome51/in-numeric-order

Loading

import { inNumericOrder } from '@writetome51/in-numeric-order'; 

Package Sidebar

Install

npm i @writetome51/in-numeric-order

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

2.94 kB

Total Files

5

Last publish

Collaborators

  • writetome51