JSFiddle - React, Tailwind, and code Playground

by stevenhollidge

JavaScript

function gizmo(id) {
    return {
        id: id,
        toString: function () {
            return "gizmo " + id;
        }
    };
}

function hoozit(id) {
    var that = gizmo(id);
    this.test = function (testid) {
        return testid === id;
    };
    return that;
}

var h = hoozit(1);
console.log(h);