We'll start refactoring a bit of imperative JavaScript composed by common programming language constructs such as data structures, conditionals and loops, to make it declarative and composed only by functions as the fundamental building block of computation. During the journey we will explore some interesting topics like combinatory logic, tail-call optimization and good design principles.