Files
30-seconds-of-code/snippets/nthRoot.md
Angelos Chalaris 8a6b73bd0c Update covers
2023-02-16 22:24:28 +02:00

393 B

title, tags, author, cover, firstSeen, lastUpdated
title tags author cover firstSeen lastUpdated
Nth root of number math chalarangelo tree-roots 2021-01-06T22:47:48+02:00 2021-01-06T22:47:48+02:00

Calculates the nth root of a given number.

  • Use Math.pow() to calculate x to the power of 1 / n which is equal to the nth root of x.
const nthRoot = (x, n) => Math.pow(x, 1 / n);
nthRoot(32, 5); // 2