I am currently working on code that when runs on Node.js logs only each of the values of the object below, delayed by one second on each iteration and concatenated with the string "you are now watching"
const episodes = [
{ id: 's06e01', title: 'Pilot' },
{ id: 's06e02', title: 'Top Banana' },
{ id: 's06e03', title: 'Charity Drive' },
{ id: 's06e04', title: 'Visiting Ours' },
{ id: 's06e05', title: 'My Mother, the Car' },
{ id: 's06e06', title: 'In God We Trust' },
{ id: 's06e07', title: 'Storming the castle' },
{ id: 's06e08', title: 'Pier Pressure' },
{ id: 's06e09', title: 'Public Relations' },
];
const finaleEpisode = { id: 's06e10', title: 'Bringing Up Buster' };
const addToPlaylist = episodes.concat(finaleEpisode)
Below is where i managed to do just that but i am aware there is a much simpler way to do this, I intended to use a loop but was unable to find a way to restore the console log after each iteration. Therefore I used Asynchronous JS to delay the printing and clearing functions
console.log("You are Now Watching " + addToPlaylist[0].id + ' ' + addToPlaylist[0].title);
setTimeout(function(){console.log('\033c'); }, 3000);
setTimeout(function(){console.log("You are Now Watching " + addToPlaylist[1].id + ' ' + addToPlaylist[1].title); }, 4000);
setTimeout(function(){console.log('\033c'); }, 5000);
setTimeout(function(){console.log("You are Now Watching " + addToPlaylist[2].id + ' ' + addToPlaylist[2].title); }, 6000);
setTimeout(function(){console.log('\033c'); }, 7000);
setTimeout(function(){console.log("You are Now Watching " + addToPlaylist[3].id + ' ' + addToPlaylist[3].title); }, 8000);
setTimeout(function(){console.log('\033c'); }, 9000);
setTimeout(function(){console.log("You are Now Watching " + addToPlaylist[4].id + ' ' + addToPlaylist[4].title); }, 10000);
setTimeout(function(){console.log('\033c'); }, 11000);
setTimeout(function(){console.log("You are Now Watching " + addToPlaylist[5].id + ' ' + addToPlaylist[5].title); }, 12000);
setTimeout(function(){console.log('\033c'); }, 13000);
setTimeout(function(){console.log("You are Now Watching " + addToPlaylist[6].id + ' ' + addToPlaylist[6].title); }, 14000);