JSFiddle - React, Tailwind, and code Playground

by mowglisanu

JavaScript

$(function () {
    function Cat()
    {  
        var self = this;
        this.Meow = function (sound) {
            alert("Meow: " + sound);
        }
        
        /*Cat.prototype.Meow = function (sound) {
            return this.Meow(sound);    
        }*/
            
        this.Kick = function () {
            MakeNoise();    
        }
            
        var MakeNoise = function () {
            //Meow("noise");
            //Cat.Meow("noise");
            self.Meow("noise");
            //this.Meow("noise");                      
        }        
    }
            
    var c = new Cat();
    c.Kick();
});