JSFiddle - React, Tailwind, and code Playground
JavaScript
function MyClass() {
this.greeting = "Where is the ice cream?";
}
MyClass.prototype.manners = function(phrase) {
return "I beg your pardon. " + phrase;
}
MyClass.prototype.talk = function() {
console.log(this.manners(this.greeting));
}
var c = new MyClass();
$.ajax({
data : JSON.stringify(c),
url : "ajax.php",
dataType : "json",
type : "post"
});