Last active
August 29, 2015 14:02
-
-
Save IvanGuardado/57518b37fa93e99aa778 to your computer and use it in GitHub Desktop.
Node.js, The Bad Parts
This file contains 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
//Example using a feasible | |
//implementation of Promise | |
function mapValues(){ | |
var list = [1,2,3,4,5,6]; | |
//doSomeAsyncTask returns a | |
//promise of type | |
//Promise[Array[Int]] | |
var values = doSomeAsyncTask(list); | |
//The map function will be executed | |
//when the promise is resolved | |
var mapped = values.map(Math.round); | |
//returns a promise of mapped values | |
return mapped; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment