JSFiddle - React, Tailwind, and code Playground

by qhoc

JavaScript

function test(input) {
    return {
        then: function(callback) {
            callback(input+1);
        }
    }
}

test(1).then(function(res) {
    alert(res);
});