For loop offsetting


Hey guys I was practicing for loops and came to a dead end.

\\This is to display the numbers between the users inputs.

var input1 = prompt("Start number?");
var input2 = prompt("end number?");

for(var i =input1; i < input2; i++) {

if I enter input1 = 1, input2 = 10.
I get from 1 - 9. 

How do I get till 10? 
Anyway to offset it without the user having to do it? 
And how do I not show "" in the console?

Thanks for the response.


try replace < with <= . This will make it so it loops when its less than or equal to, so it still loops at 10, but over 10 it doesn't. And I'm not sure if its possible to not show "" in the console, cause I think that's something to do with codecademy itself (not for certain though)


Thank you Russell '<=' fixed it...


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.