JSFiddle - React, Tailwind, and code Playground
by nickadeemus2002
HTML
<div id="wrapper"></div>
JavaScript
//create Enhancer object
function Enhancer(pattern){
this.subSection(pattern);
}
//extend Enhancer with object methods
Enhancer.prototype = {
subSection: function(pattern){
this.pattern = pattern;
this.total = 0;
this.distance=0;
}
};
$(document).ready(function(){
//create Enhaner object
var a = new Enhancer("aaa");
//show object distance property
$('<p> a.distance = '+a.distance+'</p>').appendTo('#wrapper');
});