Top 10 Basic JavaScript Interview Topics with ReactJS

What are Closures?

Closures are one of many basic concepts in JS. Though it is one of the fundamental concepts, it is very much confusing to many new developers.

Accessibility:

Web accessibility means the designing and creation of the website can be used by everyone. This support is mandatory to allow helper technology to interpret websites to people with special need.

Truthy & Falsy Values:

By default some values in JavaScript has truth or false values. Any number except Zero is considered to be a truth value in JS, and Zero is considered to be False automatically.

React Hooks:

Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.

import React, { useState } from 'react';function Example() {
// Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}

Rules of Hooks:

There are some basic rules of using hooks. They are:

  1. Only calling hooks from React Functions.

NULL VS Undefined:

If a function does not explicitly return anything then it is called Undefined. Again if we do not assign any value to a variable, it is called undefined. Undefined is negative or falsy.

Double Equal (==) Vs Triple Equal (===)

There arise some confusion regarding this == and === in JS. == just checks the value on both sides, if the value are the, then it returns true. === checks both the value and the type of data provided on both sides. If they are the and exact, then it returns true. Otherwise, t returns false.

Scope, Block Scope, Access outer Scope Variable:

Scope means the area where we can use a declared variable. For example, if we think about a function, if we declare a variable using let/constant inside this function, we can not use this variable outside the area of this function. This is called scope.

I am a self taught "Web Developer" specailizing in Front End Web Development.