Q281. How do you check whether a string contains a substring?
There are 3 possible ways to check whether a string contains a substring or not, 1. **Using includes:** ES6 provided `String.prototype.includes` method to test a string c...
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 (780 available).
There are 3 possible ways to check whether a string contains a substring or not, 1. **Using includes:** ES6 provided `String.prototype.includes` method to test a string c...
By placing static assets in the `public` directory, which is served at the root URL. ``` public/ ├── images/ │ └── logo.png └── favicon.ico ``` You can access these files...
You can validate an email in javascript using regular expressions. It is recommended to do validations on the server side instead of the client side. Because the javascri...
Next.js uses a built-in caching mechanism for static assets and API routes. You can also implement custom caching strategies using HTTP headers or libraries like `next-ca...
You can use `window.location.href` expression to get the current url path and you can use the same expression for updating the URL too. You can also use `document.URL` fo...
Cache revalidation can be handled using the `revalidate` option in `getStaticProps` or by setting appropriate HTTP headers in API routes. - **Using `revalidate`**: Automa...
The below `Location` object properties can be used to access URL components of the page, 1. href - The entire URL 2. protocol - The protocol of the URL 3. host - The host...
By using the `next/image` component, which automatically optimizes images for performance. ```jsx import Image from "next/image"; export default function Home() { return ...
You can use URLSearchParams to get query string values in javascript. Let's see an example to get the client code value from URL query string, ```javascript const urlPara...
You might choose the Pages Router over the App Router in the following scenarios: - When you need a simple file-based routing system without complex nested routes. - When...
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.