javascript function that console ogs after 3 seconds

JavaScript
// example1.js
setTimeout(
  () => {
    console.log('Hello after 4 seconds');
  },
  4 * 1000
);
Source

Also in JavaScript: