• Coding

    What I learned today | Functional Js | Higher Order Functions – Chapter 4

    If you came all the way from part 1, you should get the book: Functional JavaScript In the last post, we learned about Closures and Scopes. Today, we are addressing Higher Order Functions – Let’s do this! Higher Order Function A first-class function takes a function as an argument returns a function as a result Functions that take other functions e.g.map, reduce, filter methods take arrays as first arguments and a function as second By taking a function instead of a value, you are less restricted Use functions, not values See the Pen Functional JS: Higher Order Functions by Ajala Comfort (@AJALACOMFORT) on CodePen. That is all I learned about…

  • Coding

    What I learned today | Functional Javascript: Variables Scope and Closures

    Remember the Book: Functional JavaScript   So chapter 3 right?…hm Scopes From my understanding, where a variable lives, while the extent of a scope means how long a variable holds a value. Global Scope This has the longest lifespan when you declare a variable without the var, you are defining a global variable (accessible to every function and method in the program) Lexical Scope refers to the visibility of a variable and its value If I understood correctly, the closest variable value takes precedence Dynamic Scope The value at the top of the stack in a binding is the current value The poison of dynamic scoping (quote): the value of…

error: Content is protected !!