CFG-looping-for

by Alan Gardner

HTML

<div id="results"></div>

JavaScript

var example = 'You can use the following line to output results.';
$('#results').append('<p>' + example + '</p>');


// forward loop
var sayTenTimes = function (phrase) {
    // loop goes here
};

sayTenTimes('hello!');


// backward loop
var countdown = function (times) {
    // backwards loop goes here
    
    $('#results').append('<p>Blast off!</p>');
};

countdown(10);