Re: _javascript_ Problems
@8:
You would be right that I am kind of coming at the JS as a backward.
As soon as I'm done with the language basics, I'll move on to node, since that's what I'm after anyway.
Now, another problem:
the code below gives me uncaught syntax error: illegal return statement.
But my return statement is within a function, So why is that?
Here's the code: it's suppose to raise the first number to the power of second.
<!DOCTYPE html>
<html>
<body>
<script>
let number = prompt("Enter the number");
let power = prompt("what power do you want to raise this number to?");
pow(number, power)
{
for (let i = 2; i <= power; i++) {
number = number * i;
}
return number;
}
alert(pow(number, power));
</script>
</body>
</html>
I don't have much of a problem with the algorithm, but the return statement is causing a problem.
Also, is it wrong for me to miss the simplicity of the scanf and printf?
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector