JSFiddle - React, Tailwind, and code Playground

by amatiasq

HTML

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

JavaScript

var Vector = {
    constructor: function(x, y) {
        this.x = x;
        this.y = y;
    },
    toString: function() {
        return 'Vector[' + this.x + ',' + this.y + ']';
    }
};

var v = Object.create(Vector);
v.constructor(0, 0);

console.log(v);