setTimeout()
setTimeout() is a JavaScript function in the Global category. Executes a function after a delay (ms). The syntax is setTimeout(callback, delay, ...args). A typical example: setTimeout(() => console.log("Done"), 1000). Another practical use — Delay execution: console.log('Start') setTimeout(() => { console.log('This runs after 1 second') }, 1000) console.log('End') The TypeScript signature is (callback: (...args: any[]) => void, ms?: number, ...args: any[]): number. Common pitfall — this inside setTimeout refers to window/global. In non-arrow functions, this inside setTimeout refers to the global object (window in browsers). Use arrow functions or .bind() to keep the correct context. A close sibling is clearTimeout(), which cancels a timeout. A close sibling is setInterval(), which repeatedly executes a function with a fixed delay. A close sibling is clearInterval(), which cancels an interval. A close sibling is setImmediate(), which executes a function after the current event loop (Node.js). More about this category: Global functions — setTimeout, fetch, parseInt, and more.