// Some extra problem solutions, with few comments. function main() { var a = reverse(new Array(1, 2, 3)); var i = 0; for (i=0; i= 50) { alert("More than 50 numbers."); } else { a[i] = n; i = i + 1; } n = numberInput("Enter a number or 0 to quit: "); } i = i - 1; while (i >= 0) { formOutput(a[i] + "\n"); i = i - 1; } // end problem 2 formOutput("Problem 5: "); formOutput(countLess(2, new Array(1, 2, 3, 4)) + "\n\n"); formOutput("Problem 6: "); formOutput(whereLess(2, new Array(5, 2, 6, 1, 7)) + "\n"); } function reverse(a) { var i = 0; var copy = new Array(a.length); for (i=0; i