coderef

Math.sumPrecise()Baseline · Newly available

The Math.sumPrecise() static method returns the sum of an iterable of numbers. It avoids the precision loss of intermediate partial sums, as found using reduce() or a loop to add together an array of values.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Apr 10, 2026.

Browser support

DesktopChrome
1–146Not supported
147+Supportedsince Apr 7, 2026
Current: 155
Edge
12–146Not supported
147+Supportedsince Apr 10, 2026
Current: 154
Firefox
1–136Not supported
137+Supportedsince Apr 1, 2025
Current: 157
Safari
1–26.1Not supported
26.2+Supportedsince Dec 12, 2025
Current: 27
MobileChrome Android
18–146Not supported
147+Supportedsince Apr 7, 2026
Current: 155
Firefox Android
4–136Not supported
137+Supportedsince Apr 1, 2025
Current: 157
Safari iOS
1–26.1Not supported
26.2+Supportedsince Dec 12, 2025
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Apr 10, 2026. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: sumPrecise.

Feature detection

JS · check before using
if ("sumPrecise" in Math || ("prototype" in Math && "sumPrecise" in Math.prototype)) {
  // Math.sumPrecise is available
}

Documentation (MDN)

Specification