JSFiddle - React, Tailwind, and code Playground

JavaScript

// Let's not pollute the global namespace.
(function(){
    // The constructor:
    function test() {
        // No "new" keyword means that this refers to the window!!!!
        alert(this.innerWidth);
    }
    
    test();
})();