how to perform an action every second in javascript code example
Example: javascript function that console ogs after 3 seconds
// example1.js
setTimeout(
() => {
console.log('Hello after 4 seconds');
},
4 * 1000
);
// example1.js
setTimeout(
() => {
console.log('Hello after 4 seconds');
},
4 * 1000
);