JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q35847F
  • License MIT

Sorting Arrays of Numbers in JavaScript, Find Largest and Smallest Number.

Package Exports

  • numbersort

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 (numbersort) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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);