Are you one of them?

Photo by on

You might have heard that variables hoist, and hoisting this and hoisting that. Let me tell you this beforehand ‘Hoisting’ is an English language convention that we have made up to discuss the idea of lexical scope without thinking about lexical scope.

I will show you why it does not exist and why it is not even possible for it to subsist with a simple piece of code. (Before you begin, please go and have a look for some fundamental Concepts of JS and understand what all those scary terms likemean.)

Let us…


The only article you need to read to make sense of the “this” keyword in JavaScript.

Photo by on

In this article, we cover the all-important yet so confusing topic in JavaScript which is the “this” keyword.

TL;DR

If “this” scares you, do not worry! We will learn how to determine the value of the “this” keyword using five simple rules.

Those five simple rules are as follows:

  • The Regular One — Default binding
  • Function Inside an Object Implicit binding
  • Function Borrowing Explicit binding
  • Using Function to Create ObjectsNew binding
  • How Arrow Function Differs from the Regular Ones— Lexical binding


Become a better developer after reading this article.

Photo by on

A Brief History on the Origins Of Bugs

Today, a bug is a term that is used to denote a fault, error, or failure in a piece of computer software, which yields an undesirable result such as a software crash, or incorrect behavior on part of the program.

On September 9–1947, a team of computer scientists and engineers reported the world’s first computer bug. It was not the first time somebody used the word bugs like in this context. …


Learn how programmers use closures to solve various problems

Photo by on

This article is the third part of the series, where we explore the Origins, Under the hood working, Usage in real life, Interview Question related to Closures.

Closures and Memory

Closures can make our code very memory efficient. I have a function here, and we will call it find(), and in this function, we have created array named bigArray. We have used the fill method that comes with arrays, and filled it in with 10000🙏. Our function returns the element of the bigArray based on the index provided as an argument.


Understand Closures in Plain English

This article is the second part of the series where we explore the Origins, Under the hood working, Usage in real life, Interview Question related to Closures.

Welcome to the second part, in this article — we will grok Closures and under the hood mechanism of how they work. Many find the concept of closures very hard. But it won’t be so once you know what happens under the hood.


How JavaScript Borrowed a Decades-Old Idea from Lisp

This article is the first part of the series, where we explore the Origins, Under the hood working, Usage in real life, Interview Question related to Closures.

Introduction

Quite possibly the most essential standards of virtually all programming dialects is the capacity to store values in variables, and later access or change those qualities.

Without such an idea, a program could play out certain undertakings, yet they would be very restricted. The inclusion of variables into our program begets the most interesting questions like where do those variables live? In other words, where are they stored? …


Ace every question regarding JavaScript closures

Photo by on

This article is the last part of the series, where we explore the Origins, Under the hood working, Usage in real life, Interview Question related to Closures. If you haven’t followed the series, then it is highly recommended that you

Interview Begins

Interviewer: Can you tell us something about Scope in JavaScript?

You: Yeah! Sure, Scope is the region where the variable is available in the code.

Interviewer: Can you elaborate a little bit?

You: In JavaScript, scope refers to the current context of your code. Scopes can be globally or locally defined. …


Don’t be scared of the ‘this’ keyword

Illustrations by

Some say that it is the most confusing concept they encounter. For some, it is the most difficult concept to grasp. Some even hate it so much that they try to avoid it at all cost in their code because it creates so much confusion.


Are you struggling with it too?

Photo by from

Have you ever heard the word “API,” and wondered exactly what it is? Do you have a vague idea of what it does or what it is used for?

This is something that you will encounter when you first start programming with any sort of web technology. Many newcomers struggle with this concept, and many get some vague ideas about it and assume that they know what it is.

Now APIs to web programming but it’s something that you use a lot when you are programming for the web or mobile. In the past, APIs were largely associated…


Unravel the secrets that remain hidden from the majority of Developers

Photo by on

You will occasionally want a group of statements to get executed more than once. We accomplish this task using loops. In most programming languages, the majority of code execution time is spent within loops. Looping over a series of values is one of the most frequently used patterns in programming and as such is also one of the areas where efforts to improve performance must be focused. Understanding the performance impact of loops in JavaScript is especially important, as infinite or long-running loops severely impact the overall user experience.

There are loop types provided by JavaScript. In this article…

Somnath Singh

A Modern Day Polymath

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