Created
September 14, 2015 03:12
-
-
Save brunops/7ebc44729971d0d1216f to your computer and use it in GitHub Desktop.
transform order diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var q = require('q'); | |
function subtract2(data) { | |
return data - 2; | |
} | |
function multiply5(data) { | |
return data * 5; | |
} | |
q(2) | |
.then(subtract2) | |
.then(multiply5) | |
.then(console.log) // 0 | |
.done(); | |
q(2) | |
.then(multiply5) | |
.then(subtract2) | |
.then(console.log) // 8 | |
.done(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment