Continuation Cllaback
https://github.com/eu81273/jsfiddle-console
HTML
<script src="https://rawgit.com/eu81273/jsfiddle-console/master/console.js"></script>
JavaScript
var f1 = (x,callback)=>callback(x*x);
f1(2,x=>f1(x,console.log)); // prints 16
const squareCont = (x)=>callback=>callback(x*x);
const squarePromise = (x)=>({then:callback=>callback(x*x)});
squarePromise(2).then(r=>console.log(r))