JSFiddle - React, Tailwind, and code Playground

HTML

<div id="result">

</div>

JavaScript

var State = function(name, pop) {
  this.name = name;
  this.pop = pop;
};

State.prototype.cjl = function(method) {
  return this.cjlDefs[method].apply(this, Array.prototype.slice.call(arguments, 1) );
};

State.prototype.cjlDefs = {
  getPop: function() {return this.pop;}
};


var Washington = new State('Washington', 80000);
$('#result').text( Washington.cjl('getPop') );