We will be covering basic concept every JavaScript programmer must know and master this.

1. IIFE

IFEE (Immediately Invoked Function Expression) is a JavaScript function that executes when it is defined.

(() => {
console.log(“Hello World”);
})()

This might look quite confusing at first but actually, the pattern is very simple.

Normally JavaScript functions can be created either through a function declaration or a function expression. A function declaration is a normal way of creating a named function.

A function created in the context of an expression is also a function expression. …


I see people using older functionalities and methods and I wonder why do people stick to older syntaxes rather than the newer ones. Lets see the newer implementations and how it overcomes the older ones below!!!

1. Using var

let and const are better alternatives to var. They both have scope blocking behaviour in a more consistent way, as you would expect variables to behave like other programming language.

// Using var
for(var i=0; i<3; i++) {
console.log(i); // 0 1 2
}
console.log(i); // 3// Using let
for(let i=0; i<3; i++) {
console.log(i); // 0 1 2
}
console.log(i); // Error

2. Using regular equality


What is Context API?

The Context API is a component structure provided by the React framework, which enables us to share specific forms of data across all levels of the application. It’s aimed at solving the problem of prop drilling.

“Prop drilling (also called “threading”) refers to the process you have to go through to get data to parts of the React Component tree.”

When to use Context API?

The Context API is useful for sharing data that can be considered global, such as the currently authenticated user, the theme settings for the application, and more. …

Antony Raj

I’m a deeply passionate young programmer. You’ll probably find me honing my programming skills.In my spare time I contribute to these domains using my skills.

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