JSFiddle - React, Tailwind, and code Playground

JavaScript

var NS = {
      user     : "self",
      getUser  : function() { return this.user; }
    };


    var CLOSURE = NS.getUser;

    // error user is undefined, this refers to the global object, "window"
    console.log(CLOSURE());
    
    // YAY we bind the function call to NS.
    console.log(CLOSURE.bind(NS)());