Installing Node on Linux
· ☕ 2 min read
I recently ended up with a low-end box with CentOS 7. After a long, long time, I got to try out skills on anything other than a managed Ubuntu / RHEL / Windows server/client. The fact that the box depended on me to get the app running was exciting but scary.

Top Javascript Frameworks for 2019 (Yes, clickbait)
· ☕ 3 min read
tldr; There is no spoon. Longer version There is no one answer. Choose one, and get the job done. Even longer version Javascript is versatile and blah blah. But, how should you begin your search for the right framework? It took me no less than 3-4 weeks to get acclimatized with the nuances and settling down with a favourite framework.

Who's afraid of recursion?
· ☕ 2 min read
Spoiler alert: I am. What is recursion anyway? A program calling itself. How does it look? conquerPlanet() { // infinite loop - there are too many planets to conquer conquerPlanet(); } OK.. how about a practical use case? Well, I am not quite a ‘theory’ guy. But here you go with the age old problem of calculating factorial.

The Right WSL Setup for using Node
· ☕ 3 min read
A few node packages have been causing me pain lately. Who knew that my Windows 10 addiction can get me into trouble with node? There are, of course, multiple ways to solve the node problem on Windows. Do not use the offending package :). If there is no support for Windows, your great program does not get written using the specific package.

Spread Operators in Javascript
· ☕ 3 min read
A spread operator (...) provides a quick way to expand a Javascript object or array. Array or object is a collection of values. Accessing individual values within the array will require one to use a loop. 1 2 3 4 5 6 7 8 9 10 const fruits = ["orange", "apple"]; for (let i = 0; i < fruits.

Variable Scoping in Javascript
· ☕ 5 min read
Scope of a variable refers to the visibility of that variable. Since the visibility of a variable also determines whether it can be referenced in a valid way, scopes are said to define the ‘life time of a variable’. Scopes in Javascript can be global to the program, or local to the specific block and function.

Operator Precedence in Javascript
· ☕ 2 min read
Operator precedence includes unary, increment, basic arithmetic, logical and assignment operators - roughly in that order. The precedence can be remembered by BEUDMASLAS. brackets exponent unary & prefixed increment / decrement division multiplication addition subtraction logical assignment suffixed increment / decrement Not quite exciting as BODMAS or PEDMAS (math, anyone?

Javascript New Keyword
· ☕ 2 min read
New operator is used to initialize objects and create a new instance of the object. You would have seen new used in the object context in an earlier post. The usage is something like the below - 1 2 let worldExists = new Boolean(false); console.log(worldExists); // [Boolean: false] worldExists is an object that has a value of type ‘boolean’.

Rest Parameter in Javascript
· ☕ 1 min read
Rest parameter enables you to signify an ‘infinite’ parameter to a function. ... serves two purposes in Javascript - Spread operator - know what spread operators can do Rest parameter for a function Rest parameter just tells Javscript that there can be zero or infinite parameters for the function.

Object Assign Method in Javascript
· ☕ 1 min read
assign method of an object allows us to merge two objects quickly. 1 2 3 4 5 const name = { name: "earth" }; const position = { position: 3 }; const planets = Object.assign(name, position); console.log("planets: ", planets); // { name: 'earth', position: 3 } You can also use Object.

Property Descriptors in Javascript
· ☕ 2 min read
Property descriptors define property behaviour. They are attributes of the property. Everything is an object in Javascript. Yes, I know - except those pesky things called primitives on which objects are built. We saw some (quick discussions on objects and properties)[/objects-and-props-in-javascript/] before - but I wanted to outline the descriptors further.

Currying in Javascript
· ☕ 2 min read
Currying is a technique of splitting functions with one or more arguments into a sequence of functions that are invokable with predefined arguments. In other words, you can split fn (a,b,c) into fn(a)(b)(c). That was not quite helpful - let us see an example. 1 2 3 4 5 6 let getSquared = (x, y) => { return x * y; }; let getSquared = getProduct.

Comma operator in Javascript
· ☕ 2 min read
Did you know how to use comma operator in Javascript? A simple , can separate expressions in the same statement, evaluate left-to-right in the expression, pick the right most valid value as the result, and confuse other developers - all within the blink of an eye. We have discussed about operators when discussing operator precedence.