NGINX is a powerful and widely used web server that excels in delivering high-performance web content. In this article, we will guide you through the process of setting up NGINX on an Ubuntu server and activating a domain on the NGINX server. We will cover the installation, configuration, and management of NGINX, along with the…
Functional Component vs Class Component in React.Js
A functional component in React is a JavaScript function that returns a React element, which is an object that describes a part of the UI. Functional components are also known as “stateless” components because they do not have a state. A class component in React is a JavaScript class that extends React.Component class. It has a state, which can be used to store the data that the component needs to render.
React.Js Lifecycle Methods
In React, a component goes through different phases in its lifecycle, and at certain points in each phase, React will call specific methods on the component. These methods are known as lifecycle methods. componentDidMount(), componentDidUpdate(prevProps, prevState), componentWillUnmount(), shouldComponentUpdate(nextProps, nextState)
What is componentDidMount and useEffect with Example
componentDidMount() is a lifecycle method in React that is called after a component has been added to the DOM. useEffect is a Hook in React that allows you to synchronize a component with an external system. It serves a similar purpose as componentDidMount(), componentDidUpdate(), and componentWillUnmount() lifecycle methods combined.
React Hook To Check If User Has Changed/Minimize the Browser Tab
Today we will learn how to develop a Custom React-Js hook to determine whether theĀ user has changed the browser tab or minimized the browser window. This hook will work for Chrome, Opera, Firefox, Edge, Safari etc…
Custom React Hook – Get Device Screen Information – Simple JavaScript Code
Get User Device Screen Information using React Js Hook. Hello Readers… In this article, we will learn how to create our own hook for react js. There is a large number of hooks available in React Js. But also some important features/hooks are still missing in this framework. Today we are going to develop our…
Spread Operator and Rest Parameters in JavaScript
Spread operator in JavaScript was introduced in ES6. The syntax of the spread operator is 3 dots. The spread operator allows us to spread out the elements of an iterable object such as an Array, Map, or Set. Rest parameter in javascript allows us to handle multiple parameters in any function. We can pass an indefinite number of parameters to any function. By the use of the rest parameter, we can call a function with any number of arguments.
Find and return the sum of missing and duplicate number – Easy Code
The input “nums” is supposed to be an array of unique integers ranging from 1 to nums.length. However there is a mistake: one of the number in the array is duplicated, which means another number is missing. Find and return the sum of the duplicated number and the missing number. Example: In the array [4,…