13
u/awekening_bro May 13 '21 edited May 13 '21
When recursion is bae
const pow = (base, i) => {
If(i === 0) return 1;
return base * pow(base, i - 1);
}4
4
u/danielsan1701 May 13 '21
// Barking up the wrong tree
const notPower = 4^3; // 74
6
3
u/Chef619 May 13 '21
Has anyone ever used this? <- not a snarky comment.
1
1
u/samanime May 13 '21
I had to use it as part of automatically calculating an even-number axis for a graph (specifically, used to determine the magnitude of the number).
1
0
46
u/grantrules May 13 '21
Extra longhand!
/obviously not serious