JSFiddle - React, Tailwind, and code Playground
JavaScript
var x = function() {
this.val=1;
setTimeout(function() {
this.val++;
console.log(this.val);
},1)};
x();
var x = function() {
this.val=1;
setTimeout(function() {
this.val++;
console.log(this.val);
},1)};
x();