JSFiddle - React, Tailwind, and code Playground

Scope example

by kfranqueiro

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/claro/document.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/claro/claro.css">

JavaScript

function test () {
    console.log(typeof foo);
}

require([
    // insert dependencies here
    "dojo/domReady!"
], function () {
    var foo = 42;
    
    // This will log 'undefined', because foo is only available
    // within the scope of this callback, not test
    test();
});