function View(bgColor) {
    this.bgColor = bgColor;
    this.x = 0;
}

View.prototype = (function () {

    return {
        doResolve: null,

        // alias for promise
        then: function (r) {
            this.doResolve = r;
        },

        update: function () {
            console.log(this.x);
            if (this.x++ === 5) {
                this.doResolve();
            }
        },

        render: function () {
            console.log(this.bgColor);
            document.body.style.backgroundColor = this.bgColor;
        }
    };
})();


var title = new View("red");
title.then(function () {
    console.log("inRed");
    view = lvl;
    view.render();
});

var lvl = new View("orange");
lvl.then(function () {
    console.log("inOrange");
    view = last;
    view.render();
});

var last = new View("purple");
last.then(function () {
    console.log("inPurple");
    clearInterval(inter);
});


var view = title;
view.render();
var inter = setInterval(function () {
    view.update()
}, 1000 / 3);

@@ -115,63 +115,8 @@
 n %7B%0A
-        doResolve: null,%0A%0A        // alias for promise%0A
     
@@ -135,17 +135,24 @@
 nction (
-r
+callback
 ) %7B%0A    
@@ -168,21 +168,23 @@
 his.
-doResolve = r
+then = callback
 ;%0A  
@@ -315,17 +315,12 @@
 his.
-doResolve
+then
 ();%0A

Update promises.js