var arr = ['html5', 'EDM', 'Coca Cola', 'creativity']; var index = 0; setInterval(function() { console.log(arr[index++]); if (index == arr.length) index = 0 }, 5000);