Random Things You Should Know as an Intermediate JavaScript and ReactJS Developer

Shahriar Islam Sakil
3 min readNov 5, 2020

JavaScript is like the backbone of the web. It’s directly or indirectly related with most of the websites in the world. And one of it’s library, React, is also the most popular tech for building web apps right now. So here are some randomly selected topics from the to boost your knowledge a bit more.

Hooks

Hooks are a part of functional component in ReactJS. They are basically a simpler method of encapsulating stateful behavior and side effects in user interfaces. React was the first library to introduce hooks. But other frameworks and libraries have started adding hooks into their arsenal ever since.

Accessibility

This is a property of your JavaScript/React application that signifies the readability of your application by various endpoints. By endpoints I mean technologies and humans. For example, you should use semantic elements so that your app’s performance increases behind the scene.

Scope

You can think of scope like a container or environment that has access to variables. Multiple scopes can be present inside one another and the access pattern of their variables is known as scope chain. This scope chain determines where you can access a certain variable from.

Truthy and Falsy Values

There are some keywords in JavaScript that don’t have any particular value. But the are evaluated as false in a condition check. These values are called falsy values. And those who are evaluated as true are called truthy values.

Type Coercion

Typer Coercion means to convert one type into another. In JavaScript, if you concatenate a string and a number and display it in the console, you will get a string. So they number is converted into a string. This is called type coercion.

Type Coercion in Condition Checking

If you use “==” to check similarity between two things in JavaScript, the mentioned operator will do so after making them into similar types. So if you compare “2” and 2, it will give you true. So double equal does a type coercion. However, the triple equal does not and will give you false.

The “this” keyword

The “this” keyword is used as a pointer to point at an object or a function. For example, in a regular function call, the “this” keywords refers to the global execution context or the global scope. But in a method call, the this keywords refers to the object whose method is invoked.

Asynchronous JavaScript

As JavaScript is single-threaded language, it can only do one task at once. So if there is something that is needed later on, its initialization will block the rest of the code for as long as it’s not done. For this reason, those codes are handled asynchronously while the main code runs on the background.

The “new” Keyword

In JavaScript, when you need to make an empty object, you have to use the “new” keyword. This will create an empty object and set the “this” variable to the newly created object. So all references will be to the object created with the “new” keyword.

Null vs Undefined

When something is declared but does not have a value, it’s value is set and output as “null”. However, when a variable is not declared in the first place, it returns undefined. This can be useful to debug your code. If you can understand whether you’re getting a wrong value or you don’t have the variable.

--

--