JSFiddle - React, Tailwind, and code Playground

by swesh

JavaScript

window.foo = function (x) {
  var tmp = 3;

  function bar(y) {
    console.log(x + y + (++tmp)); // will alert 16
  }

  bar(10);
}
function as(){
    window.foo(2);
}
as();