everyutil
Version:
A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.
9 lines (8 loc) • 337 B
TypeScript
/**
* Returns the first derivative (difference) between consecutive elements of an array.
* For example, delta([5, 7, 10]) returns [2, 3].
* @author @dailker
* @param {number[]} array - The input array of numbers.
* @returns {number[]} The array of differences.
*/
export declare function delta(array: number[]): number[];