Q321. How do you search a string for a pattern?
You can use the `test()` method of regular expression in order to search a string for a pattern, and return true or false depending on the result. ```javascript var patte...
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).
You can use the `test()` method of regular expression in order to search a string for a pattern, and return true or false depending on the result. ```javascript var patte...
React creates a service worker for you without any configuration by default. The service worker is a web API that helps you cache your assets and other files so that when...
The purpose of exec method is similar to test method but it executes a search for a match in a specified string and returns a result array, or null instead of returning t...
Class components can be restricted from re-rendering when their input props are the same using **PureComponent or shouldComponentUpdate**. Now you can do the same with fu...
You can change inline style or classname of a HTML element using javascript DOM-manipulation 1. **Using style property:** You can modify inline style using style property...
The `React.lazy` function lets you render a dynamic import as a regular component. It will automatically load the bundle containing the `OtherComponent` when the componen...
The output is going to be `33`. Since `1` and `2` are numeric values, the result of the first two digits is going to be a numeric value `3`. The next digit is a string ty...
You can compare the current value of the state with an existing state value and decide whether to rerender the page or not. If the values are the same then you need to re...
The debugger statement invokes any available debugging functionality, such as setting a breakpoint. If no debugging functionality is available, this statement has no effe...
**Note:** This question references React 16. These features remain valid in current React versions (18/19). **Arrays**: Starting with React 16, you can return multiple si...
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.