Created
March 10, 2017 11:33
-
-
Save Gaya/8d8386fb5305373bdd9a07c83ef545ad to your computer and use it in GitHub Desktop.
Revisions
-
Gaya created this gist
Mar 10, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ function add(thing) { // dit krijg 'eng' van residentEvil(); // maak alvast een functie die later in then() aangeroepen wordt return function(list) { // list = ['leuk'] return list.concat([thing]); } } function residentEvil() { return 'eng'; } function gamen() { return new Promise((resolve) => { resolve(['leuk']); }); } gamen() // resolved ['leuk'] .then(function (dingen) { const functieDieResidentEvilDoet = add(residentEvil()); return functieDieResidentEvilDoet(dingen); }) // zelfde als: //.then(add(residentEvil())) .then((dingen) => { // dingen = ['leuk', 'eng'] })