JSFiddle - React, Tailwind, and code Playground

by James Allardice

JavaScript

var f = function() {
   this.m = '10'; 
   this.f1 = function(){
       alert(this.m); //Notice that this has changed to `this.m`
   };
}; //Function expressions should be terminated with a semicolon

var o = new f();
o.f1();