Math.abs?

Benchmark created on


Setup

const n = -12412515;

function abs(n) {
	return n > 0 ? n : -n;
}

Test runner

Ready to run.

Testing in
TestOps/sec
Math.abs
const m = Math.abs(n);
ready
abs func
const m = abs(n);

ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.