Skip to content

Getting Started

Maths.js gives you practical statistics and numeric helpers without a heavyweight dependency.

Terminal window
npm install @peterbenoit/mathsjs
const Maths = require('@peterbenoit/mathsjs');
console.log(Maths.avg(10, 20, 30)); // 20
console.log(Maths.median(1, 3, 2)); // 2
<script src="/path/to/Maths.js"></script>
<script>
console.log(Maths.sum(1, 2, 3)); // 6
</script>
  • Continue with Browser Usage for script-tag patterns.
  • Continue with Node Usage for package-based usage.
  • Check API Reference for all methods and signatures.