JSFiddle - React, Tailwind, and code Playground

by Aaron Zhang

JavaScript

(function () {
    function Chainable() {}

    Chainable.prototype = {
        chainA: function () {
            console.log('chainA() called');
            return this;
        },
        chainB: function () {
            console.log('chainB() called');
            return this;
        },
        chainC: function () {
            console.log('chainC() called');
            return this;
        }
    };

    var c = new Chainable();
    c.chainA().chainB().chainC();
})();