Something to note is that you can transform some impure functions into pure ones by delaying evaluation var pureHttpCall = function (url, params){ return function() { return $.getJSON(url, params); }; }; We don't actually make the HTTP call - we instead return a function that will do so when called. This function is…