Q571. How do I modify the url without reloading the page?
The `window.location.href` property will be helpful to modify the url but it reloads the page. HTML5 introduced the `history.pushState()` and `history.replaceState()` met...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (1,100 available).
The `window.location.href` property will be helpful to modify the url but it reloads the page. HTML5 introduced the `history.pushState()` and `history.replaceState()` met...
1. **Setup Function Execution (`useEffect`)** The setup function (or the main function) you pass to `useEffect` runs at specific points: 1. **After the component is mount...
The `Array#includes()` method is used to determine whether an array includes a particular value among its entries by returning either true or false. Let's see an example ...
You should NOT return a Promise from useEffect. React expects the function passed to useEffect to return either nothing (undefined) or a cleanup function (synchronous fun...
You can use length and every method of arrays to compare two scalars (compared directly using `===`) arrays. The combination of these expressions can give the expected re...
Yes, multiple useEffect hooks are allowed and recommended when you want to separate concerns. ```jsx useEffect(() => { // Handles API fetch }, []); useEffect(() => { // H...
The `new URL()` object accepts the url string and `searchParams` property of this object can be used to access the get parameters. ```javascript let urlString = "http://w...
Infinite loops happen when the effect updates state that’s listed in its own dependency array, which causes the effect to re-run, updating state again and so on. **Infini...
You can use the `Number.prototype.toLocaleString()` method which returns a string with a language-sensitive representation such as thousand separator, currency etc. of th...
You need to use `useLayoutEffect` when your effect **must run before the browser paints**, such as: * **Reading layout measurements** (e.g., element size, scroll position...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.