JSPM

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

Gets the sum of values

Package Exports

  • @kwsites/math-sum

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

Readme

@kwsites/math-sum

A lightweight library for summing numbers together.

Usage

Install using npm npm install @kwsites/math-sum or yarn then use with require:

import { sum } from '@kwsites/math-sum';

const numbers = [123, 456, 789];
const count = sum(numbers);

assert(count === 1368);

If the name sum clashes with your own variable naming, and you prefer not to alias in your imports, you can use its alias sumOf;

import { sumOf } from '@kwsites/math-sum';

const numbers = [123, 456, 789];
const sum = sumOf(numbers);

assert(sum === 1368);