Learning to Program by Steven Foote

Learning to Program by Steven Foote

Author:Steven Foote [Foote, Steven]
Language: eng
Format: epub
Publisher: Pearson Education
Published: 2014-10-16T06:00:00+00:00


// y is greater than x, so we're counting up.

incrementor = function(idx) {

// increase the value of the index by 1

return idx + 1;

}

comparison = function(idx, num) {

// until the index is no longer less than or equal to the ending number

return idx <= num;

}

}

// The starting number is x

// Use the comparison function to know if we should keep looping

// Use the incrementor function to know which direction to count

for (var i=x; comparison(i, y); i = incrementor(i)) {

console.log(i);

}

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.