JSFiddle - React, Tailwind, and code Playground

by amatiasq

HTML

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

JavaScript

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

var MyNumber = {
    new: $new,
    
    constructor: function(value) {
        this.value = value;
    },
};

var num1 = MyNumber.new(3);
var num2 = MyNumber.new(3);

console.log(num1 === num2);