+ 2
Hi, what do i miss?
function factor(x) { z=1 for(i=1; i <=x; i++){ z=z*i; } document.write(x); } var y = prompt("blabla?"); if (y>=o){ factor(y); } else document.write("blibli");
2 Respostas
+ 8
1) "y >= o", thats an o (letter) not a 0.
2) "document.write(x);"
Did you want to show the factorial?
So: document.write(z);
*Try using proper naming conventions to avoid this confusion.
3) i needs to be a var,
for(var i = 1; etc..)
same with z,
var z = 1;
+ 3
ohh, thanks. Now it working))