function canMakeHTTPRequest() { return typeof globalThis.XMLHttpRequest === 'function'; } console.log(canMakeHTTPRequest()); // Expected output (in a browser): true