var i = 0;
setInterval(function() {
document.writeln(i++);
}, 666);
function xxx(i) {
document.writeln(i);
setTimeout(xxx, 666, i + 1);
}
xxx(0);
function* cyclicSequence(items) {
for (var i = 0; ; i = (i + 1) % items.length) {
yield items[i];
}
}
var color = cyclicSequence([ 'green', 'red', 'blue', 'yellow' ]);
$('#typeProject').click(function() {
$('.typeProject').css('background-color', color.next().value);
});