Create Closure for Iterative setTimeout

HTML

<span id="dashboardDisplay"></span>

JavaScript

$(function(){
    var dashboards = [
        'choc',
        'full',
        'of',
        'nuts',
        'is',
        'that',
        'heavenly',
        'coffee',
        'heavenly',
        'coffee',
        'heavenly',
        'coffee'
    ];
    
    var length = dashboards.length;
    
    function chain(y) {
        $('#dashboardDisplay').text(dashboards[y]);
        setTimeout(chain, 1000, (y+1) % length);
    }
    
    chain(0);
});