Thunk and Currying – Know Your JavaScript!

thunk

Thunk A thunk usually refers to a small piece of code that is called as a function; does some small thing; and then JUMPs to another location; which is usually a function; instead of returning to its caller. Assuming the JUMP target is a normal function, when it returns, it will return to the thunk’s caller. The word … Read more

Rest and Spread – Things you can do with just 3 dots in Modern JavaScript!

three dots

Before diving into rest and spread; let’s have some background info. What do you think the output for the above code? Yes, you guessed it right. JavaScript will not throw any error when we call a parameter-less function with any number of parameter and it will output ‘no issues‘. As such; the following code is … Read more

JavaScript Generators Magic and Their Use Case: Everything Yield Need To Know

javascript

JavaScript generators is an amazing and brilliant concept; yet it’s very confusing when to use them. They let us write infinite loops that terminate. The yield values from functions before they finish and build lazy data structures. The magic lies in the ability of generators functions to be paused and then resumed again. But before … Read more