Syntax

TypeScript
import { variance } from '@opentf/std';

variance<T>(arr: T[], cb?: (val: T, index: number) => number): number;

Returns

The population variance.

Sparse array holes are ignored.

Examples

TypeScript
variance([2, 4, 4, 4, 5, 5, 7, 9]) //=> 4
Last updated on
Edit this page