JavaScript Interview Question

WHAT IS TRUTHY VALUE OR FALSY VALUE?

Truthy value or Falsy is a value what is cast in boolean. When we use if else, if and else are work as a boolean like Yes or No.

if your values are ‘false’, 0, ‘’ ‘’, NaN, null or undefined its a falsy value. Else its truthy value.

WHAT IS ‘this’ KEYWORD?

‘This’ is one of the most tricky and confusing topics in JavaScript. This is a reserved keyword in JavaScript, meaning this name can no longer be used for any variables or functions. And this is used in many ways in many places. The value of this is usually determined based on…


React fundamental

What is React?

React is a JavaScript library created for building fast and interactive user interfaces for web and mobile applications. React is a library not a framework, that’s why its not a complete solution, you also need use more library for work.

React is open-source and maintain by Facebook. Since browsers understand Javascript, React to use describe for User Interface.

REACT IS NOT A FRAMEWORK

Lets find the difference between framework and library. Those are totally different. Framework is a broad thing which have too many things for work.

Example: ANGULAR JS, VUE JS.

These frameworks created by dedicated teams, and ship with everything you need to…


JavaScript ES6 Fundamentals

ES7 is currently the most preferred version of JavaScript developers. But the problem is that it is not yet fully supported in all browsers. However, most of the features are supported now. But even then, since it is not fully supported, you have to be very careful in using it. Occasionally using a transpoiler, the code of ES6 needs to be taken to ES5. Lets discuss something about ES6 with a cup of coffee.

Hoisting

Hoisting is a default behavior of JavaScript. Normally JavaScript took all our declaration to Top, its a default behavior and its call Hoisting.

That's why we…


JavaScript is a high-level programming language. In old JavaScript only use for Client Side web interaction but now JavaScript is used Front-end and Back-end Both. JavaScript is more powerful language which have many many Framework and Libraries. Advantage of JavaScript are:

Speed. Client-side JavaScript is very fast because it can be run immediately within the client-side browser. Unless outside resources are required, JavaScript is unhindered by network calls to a backend serve.

Now i will share some principle of JavaScript that you need to know well for play with JavaScript.

ARRAY

Array is a list like of JavaScript Object, most used…


React Router Hooks

Now that you understand why Hooks are added for routing, let’s see the Hooks in action.

useParams

The useParams Hook returns an object containing key-value pairs of the passed parameters in a dynamic URL.

For example, let’s say you have a User page component that accepts an id as a param in the URL.

<Route path="/user/:id">
<User />
</Route>

Import the useParam Hook from react-router-dom package.

import { useParams } from "react-router-dom";

Now you can use the Hook, as shown below.

const User = () => {
const params = useParams();
console.log(params); return (
// ...
)
}

So if you…


Using React Router

Using React Router Hooks Part-1

React Hooks were introduced with the release of React 16.8.0 to much excitement. With Hooks, developers can write cleaner components with less boilerplate compared to a class component. Many popular React packages are adding support for Hooks so developers can leverage their APIs in functional components.

React Router, the go-to routing solution for React Apps, added Hooks support in its version 5 release. These React Router Hooks provide developers with new ways to handle the router state.

In this tutorial, we’ll show you how to use Hooks with React Router and minimize code lines in…

Zahirul Islam Akash

A tech enthusiast and a die hard lover of JavaScript.

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