Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/simplestatistics/src/extent_sorted.js>default

simple statistics for node & browser javascript
Go to Latest
function default
import { default } from "https://deno.land/x/simplestatistics@v7.7.6/src/extent_sorted.js";

The extent is the lowest & highest number in the array. With a sorted array, the first element in the array is always the lowest while the last element is always the largest, so this calculation can be done in one step, or constant time.

Examples

extentSorted([-100, -10, 1, 2, 5]); // => [-100, 5]

Parameters

x

input