Q561. What is an enum?
An enum is a type restricting variables to one value from a predefined set of constants. JavaScript has no enums but typescript provides built-in enum support. ```javascr...
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 (963 available).
An enum is a type restricting variables to one value from a predefined set of constants. JavaScript has no enums but typescript provides built-in enum support. ```javascr...
The `useContext` hook can be used for authentication state management across multiple components and pages in a React application. Let's build a simple authentication flo...
You can use the `Object.getOwnPropertyNames()` method which returns an array of all properties found directly in a given object. Let's see the usage of this in an example...
Yes, it is possible. You can use multiple contexts inside the same component by calling useContext multiple times, once for each context. It can be achieved with below st...
You can use the `Object.getOwnPropertyDescriptors()` method which returns all own property descriptors of a given object. The example usage of this method is below, ```ja...
A **common pitfall** when using `useContext` with objects is **triggering unnecessary re-renders** across all consuming components — even when only part of the context va...
A property descriptor is a record which has the following attributes 1. `value`: The value associated with the property 2. `writable`: Determines whether the value associ...
When a component calls `useContext(SomeContext)` but **no matching** `` **is present higher up in the component tree**, the **default value** passed to `React.createConte...
The `extends` keyword is used in class declarations/expressions to create a class which is a child of another class. It can be used to subclass custom classes as well as ...
The `useEffect` hook accepts an optional dependencies argument that accepts an array of reactive values. The **dependency array** determines **when** the effect runs. i.e...
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.