From 325c44ac00b6753b237bb2353a85291b0f67822c Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 14 Mar 2016 04:13:01 +0100 Subject: [PATCH] Fix recursion example in documentation to return the last result correctly --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2644a31..199a2d6 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ function loop(pageNumber) { }).then(function(recursiveResults) { return [response.body].concat(recursiveResults); }); + } else { + // Done looping + return [response.body]; } }); }