JSFiddle - React, Tailwind, and code Playground

by LyndseyB

JavaScript

// if the module has no dependencies, the above pattern can be simplified to
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define([], factory);
    } else if (typeof module === 'object' && module.exports) {
        // Node. Does not work with strict CommonJS, but
        // only CommonJS-like environments that support module.exports,
        // like Node.
        module.exports = factory();
    } else {
        // Browser globals (root is window)
        root.returnExports = factory();
    }    
}(this, doSomething));

function doSomething() {   
console.log(this);
    var x = 1; 
    console.log(x);  
}