Making faster responses and decreasing dependency on external APIs.

More often than not, your backend server needs to talk to downstream services, third party APIs, and the database. These calls are expensive both in terms of time and money. Consider, for example, your API fetches popular movies from a movie API which charges you based on each call you make or, you need to get a user’s joining date to your app to display on their profile. The list of popular movies is not likely to change in a span of a few hours while the user’s joining date is not bound to change at all.

For fetching the…


One of the easiest ways to debug anything in JavaScript is by logging stuff using console.log. But there are a lot of other methods provided by the console that can help you debug better.

Let’s get started.

The very basic use case is to log a string or a bunch of JavaScript objects. Quite simply,

console.log('Is this working?');

Now, imagine a scenario when you have a bunch of objects you need to log into the console.

const foo = { id: 1, verified: true, color: 'green' };
const bar = { id: 2, verified: false, color: 'red' };

The most…


Is a parameter and an argument one and the same?

Javascript is a functional language meaning that functions are the primary modular units of execution. Functions are obviously very important in Javascript. When talking about functions, the terms parameters and arguments are often interchangeably used as if it were one and the same thing but there is a very subtle difference.

  • Parameters are variables listed as a part of the function definition.
  • Arguments are values passed to the function when it is invoked.

Why should we bother about this minute difference?

Well for starters, JavaScript does not throw an error if the number of arguments passed during a function invocation…


Making Async code beautiful since ES6

Generators are a cutting edge addition to ES6 JavaScript. Async code is harder to manage with JavaScript’s single threaded execution model and Generators and Promises are welcome inclusions in the JS arsenal. Let’s explore Generators in detail in this article.

Generators

Generators are special types of functions in the sense that unlike a traditional function generators produce multiple values on a per request basis while suspending their execution between these requests. During the pre-ES6 era, objects written as iterators served this purpose but the thing with those objects is that they are harder to maintain mostly because of the challenges in…


let, var, const, what!?

Before ES6, var was the only keyword used to declare variables in JavaScript. Unlike other languages like C, variables do not need to use different keywords based on their type. For example in C, integers undergo a different treatment as compared to strings but in JS we don’t need to specify the type of the variable when declaring it. JavaScript is a loosely typed language and this makes it simple to use but onerous to understand. More on that in another article.

With ES6 JavaScript introduced two other variable declaration keywords — let and const. …


How function declarations/variables get ‘moved’ to the top.

The term Hoisting is used in a lot of JavaScript blogs to explain identifier resolution. Using the literal meaning of the word as a metaphor, hoisting is employed to explain how Variables and Function declarations are ‘lifted’ to the top of a function or a global scope.

While this does provide a basic understanding of how JavaScript scoping works, a deeper dive helps to build a stronger foundation.

To understand the fundamentals better, let’s recap on what exactly hoisting means. …

Yash Agrawal

yash.works · @Braintree

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store