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 like Lexical Environment, Syntax Parsers, Execution Contexts mean.)
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:
Become a better developer after reading this article.
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.
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 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.
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.
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.
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? …
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 please go through it.
You: Yeah! Sure, Scope is the region where the variable is available in the code.
Interviewer: Can you elaborate a little bit?
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.
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 aren’t exclusive 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…
A Modern Day Polymath