JSFiddle - React, Tailwind, and code Playground

by Chuan Shao

JavaScript

var a;
var m, n;
var x=42, y="test";

var b = "temp";
console.log(typeof b);//string
b = 108;
console.log(typeof b);//number

var c = "hello";
console.log(c);//hello
var c = true;
console.log(c);//true

var e = "globalVariableValue";//defined outside of any function, it is a global variable, but does not store in "this".
f = "globalVariableValue2";
this.g = "globalVariableValue3";
console.log(this.e);//undefined
console.log(this.f);//globalVariableValue2
console.log(this.g);//globalVariableValue3

delete f;
delete g;
console.log(this.f);//undefined
console.log(this.g);//undefined