New course! Every coder should learn Generative AI!
Try a free lesson0
Why is this code incorrect?
The script is supposed to ask for the values of x and n and then put out the x raised to the power of n. Apparently it doesn't work like that 'use strict'; function pow(x,n){ let result = x ** n return result } let x = prompt("x?","") let n = prompt("y?","") alert pow(x,n)
3 Answers
+ 4
alert is normaly a function maybe change it to alert(pow(x, n));
0
Thank you!
0
No problem