I\'m trying to understand how promise chaining works. I\'m using q.js. Here\'s what I\'m playing with.
var Q = require(\"q\"); // npm install q // the functio
I know javascript doesn't have static types, but you need to think about types here.
Q(1); // has type Promise[Int] function (n) { return Q(2); } // has type Int => Promise[Int]
Q.then needs the second.
Q.then