JSFiddle - React, Tailwind, and code Playground

by hong owen

JavaScript

var Cat = function(){
    this.Color = "black";
    this.eat = function(){
    	alert("吃老鼠");
    };
}
Cat.prototype.A = function(){
	alert("Cat A");
};
Cat.prototype.B = function(){
	alert("Cat B");
};
var cat1 = new Cat();
cat1.eat(); //吃老鼠
cat1.A(); //Cat A