JSFiddle - React, Tailwind, and code Playground

by Porfirio Chavez

JavaScript

var Person = function(){
 var self = this;
 
 self.speak = function(str){
   console.log(str);
 }
 
 self.sleepAndWakeUp = function(){
   console.log('ZZZZZZZZZzzzzz.....');
   var interval = setTimeout(function(){
      self.speak('Good Morning');
   }, 300)
 }
}

var me = new Person();
me.speak("testing speak interface");
me.sleepAndWakeUp();