Created
March 22, 2019 08:44
-
-
Save tomi/202c35caf7cfd2078f99fc6b6b4fb721 to your computer and use it in GitHub Desktop.
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
import { from } from "fromfrom"; | |
var sequence = from([1, 2, 3, 4]) | |
.map(x => { | |
console.log(x); | |
return x; | |
}) | |
.filter(x => x > 2); | |
// Nothing is printed the console yet | |
var result = sequence.toArray(); // .toArray() forces the evaluation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment