In simple words, hoisting allows one to use variables and call functions before they’re even declared. This concept is absolutely essential to understand for a beginner. If not understood, this can cause unwanted bugs in your code!
Note: Only declarations are hoisted and not initializations.
In the global context, i.e. outside any function or object, ‘this’ keyword refers to the window object.
this.num1 = 3
console.log(window.num1) // 3
console.log(this) //window object
Well, template literals allow us to dynamically manipulate strings with more ease. Unlike regular strings, template strings are defined with the backtick (``). Apart from the syntax difference, it has special features that distinguish it from the regular strings such as the multiline string and the string interpolation feature. It helps us write string literals in a way that has a clean code structure, is readable, and easy to maintain.
let string1 =…
Synchronous languages as the name suggests, executes the code line by line, each waiting for the previous line to finish with execution. Synchronous execution is great when there is data to be processed that depends on or is depended upon on some other data. However not all situations are the same. In case of independent data processing, the code would remain stuck executing that one line and waste useful resources.
For example, consider this scenario :
When a user needs…
f-Strings are a new way to format strings in Python 3.6 and above. If you are new to Python, f-String is basically a great addition to Python’s string formatting world and by the end of the article you will know why. But if you are someone who has been using Python for long, you must have definitely used one of the two old school methods of string formatting namely, the “%” operator or the second way, format() method. …
We all are aware of the term Environment and its meaning: It is nothing but a surrounding in which we operate. Python too has its own concept of virtual environments. To begin with, let’s consider the example of a refrigerator, it is used to store food at cool temperatures. However certain food items such as meat require to be stored at cooler temperatures. Therefore the refrigerators has its own isolated “Environment” also known as a deep freezer where the meat can be stored. Hence, although the refrigerator does the task of cooling, there are some items which have different requirements…
I am a recent graduate and work as a software engineer at Persistent Systems. I believe in sharing with the community whatever I learn and I love to write!