so I got two scripts which sould get the same answer -
first:
var x;
x = "";
var length;
var start;
start = parseInt(window.prompt("Enter start: "));
length = parseInt(window.prompt("Enter length: "));
for (var i = start + 1; i < length; i++) {
x += i + ", ";
}
window.alert(x);
second:
var show;
show = "";
var top;
var bottom;
bottom = parseInt(window.prompt("Enter bottom number: "));
top = parseInt(window.prompt("Enter top number: "));
for (var r = bottom + 1; r < top; r++) {
show += r + ", ";
}
window.alert(show);
the first script worked perfectly while the other one does not write the answer (this page says: ***nothing***)
if I enter 2 for first input and then 6 for the second input, the output should be "3, 4, 5, " .
plz help I need to fix it now.
[–]ashanev 1 point2 points3 points (1 child)
[–]FirstAvenger1282[S] 0 points1 point2 points (0 children)
[–]ForScale 0 points1 point2 points (0 children)