Package Exports
- number_sorting
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (number_sorting) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Number Sorting
Installation
Install via NPM
npm install number_sorting
Install via YARN
yarn add number_sorting
Description
- This package sorts an array of numbers in ascending or descending order.
- It also finds smallest and greatest number from an array of numbers.
Usage
const sorting = require('number_sorting');
const array_of_number = [ 1, 2, 5, 4, 7, 6];
const ascending = sorting.ascending_sorting(array_of_number); // to sort in ascending order
const descending = sorting.descending_sorting(array_of_number); // to sort in descending order
const smallest = sorting.smallest_number(array_of_number); // to find smallest number
const greatest = sorting.greatest_number(array_of_number); // to find greatest number
console.log(ascending) // [ 7, 6, 5, 4, 2, 1 ]
console.log(descending) // [ 1, 2, 4, 5, 6, 7 ]
console.log(smallest) // 1
console.log(greatest) // 7