Answers for "typescript global variable globalthis"

3

typescript add global variable to window

declare global {
    interface Window {
        FB:any;
    }
}

let FB = window.FB; // ok now
Posted by: Guest on October-05-2020
0

typescript globalThis

// @ts-ignore
    console.log("globalThis.myVar: "+globalThis.myVar);
	// This will ignore the error typescript gives when using globalThis
Posted by: Guest on August-25-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language