fetch()
fetch() is a JavaScript function in the Global category. Makes HTTP requests. The syntax is fetch(resource, options). A typical example: fetch("https://api.example.com/data").then(r => r.json()). Another practical use — GET request: fetch('https://api.github.com/users/octocat') .then(res => res.json()) .then(data => console.log(data.login)) // 'octocat' The TypeScript signature is (input: RequestInfo | URL, init?: RequestInit): Promise. A close sibling is setTimeout(), which executes a function after a delay (ms). 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. More about this category: Global functions — setTimeout, fetch, parseInt, and more. Related Global methods: setTimeout(), clearTimeout(), setInterval(), clearInterval(), setImmediate(), queueMicrotask(), eval(), parseInt(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls.