How do I make a variable to the power of another variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I make a variable to the power of another variable?

Such as X to the power of Y?

8th May 2017, 12:19 AM
Ben Galbraith
2 Answers
+ 3
Math.pow (x,y);
8th May 2017, 12:23 AM
Calviղ
Calviղ - avatar
+ 2
var i=20; var example = Math.pow(i,2); console.log(example); like this?
8th May 2017, 12:24 AM
Max_N
Max_N - avatar