numbersort
v0.1.5
Published
Sorting Arrays of Numbers in JavaScript, Find Largest and Smallest Number.
Downloads
13
Maintainers
Readme
Sorting Arrays of numbers
Install Numbersort
npm i numbersort
Import numbersort into your app
import numbersort from "numbersort";
Redeclare to array for e.g (optional)
const array = numbersort;
Example array
const numbers = [1, 5, 8, 4, 10, 30];
Find the largest number in an array
const largest = array.largestNumber(numbers);
Find the smallest number in an array
const smallest = array.smallestNumber(numbers);
Sort an array of numbers in ascending order
const ascending = numbers.sort(array.Ascend);
Sort an array of numbers in descending order
const descending = numbers.sort(array.Descend);