JSFiddle - React, Tailwind, and code Playground
JavaScript
function foo(bar) {
return typeof bar === "undefined";
}
var baz = null;
for(var i=0; i<10000; ++i) console.log("1", foo(baz))
for(var i=0; i<10000; ++i) console.log("2", typeof baz === "undefined")
function foo() {
return typeof null === "undefined";
}
function bonc() {
return typeof baz === "undefined";
}
for(var i=0; i<10000; ++i) console.log("3", bonc())
for(var i=0; i<10000; ++i) console.log("4", (function(){
return typeof baz === "undefined";
})());