JSFiddle - React, Tailwind, and code Playground

by mathspountz

HTML

<script src="http://code.jquery.com/jquery.min.js"></script>
<div id="log"></div>

JavaScript

$(function() {
  function o() {
    this.arr = [0,1,2,3];
    this.x = 'hello';
  }

  o.prototype = {
  	y: 'hi',
    debug: function(){
      log("this = "+JSON.stringify(this));
      log("y = "+this.y);
      log('');
      this.arr.forEach(function(el){
          log('el = '+el);
          log('this = '+this);
      });
      log('');
    }
  }

  var a = new o();
  a.debug();
  a.x = 'a';
  a.y = 'b';
  a.debug();

  function log(p){
    $("#log").append('<li>'+p+'</li>');
  }
});