JSFiddle - React, Tailwind, and code Playground

by amatiasq

HTML

<script src="http://amatiasq.com/fiddle-console.js"></script>

JavaScript

function $new() {
    var obj = Object.create(this);
    obj.init.apply(obj, arguments);
    return obj;
}

var MyType = {
    new: $new,
    init: function() {
        this.value = "Works!";
    }
};

var instance = MyType.new();
console.log(instance.value);