From impurity to purity

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…

Interfaces

When trying to implement a pure abstract class (the equivalent of a Java interface), we should not deal with member visibility. Hence, one possible way is to declare the base class as a struct.…