Q251. How do you fetch data in a Next.js page?
Using getStaticProps or getServerSideProps in server side. ```jsx // getStaticProps export async function getStaticProps() { const res = await fetch("https://api.github.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).
Using getStaticProps or getServerSideProps in server side. ```jsx // getStaticProps export async function getStaticProps() { const res = await fetch("https://api.github.c...
The setTimeout() method is used to call a function or evaluate an expression after a specified number of milliseconds. For example, let's log a message after 2 seconds us...
A function that runs at build time to fetch data for a page. ```jsx export async function getStaticProps(context) { const res = await fetch(`https://...`); const data = a...
The setInterval() method is used to call a function or evaluate an expression at specified intervals (in milliseconds). For example, let's log a message after 2 seconds u...
A function that runs on each request to fetch data for a page. ```jsx export async function getServerSideProps(context) { const res = await fetch(`https://...`); const da...
JavaScript is a single-threaded language. Because the language specification does not allow the programmer to write code so that the interpreter can run parts of it in pa...
In the Next.js Pages Router, `getStaticProps` and `getServerSideProps` dictate data fetching and page caching behavior: ### 1. `getStaticProps` (Static Site Generation): ...
Event delegation is a technique where you attach **one event listener to a parent element** instead of adding listeners to each child element. It works because events bub...
A function that specifies dynamic routes to pre-render based on data. ```jsx export async function getStaticPaths() { const res = await fetch("https://.../posts"); const ...
ECMAScript is the scripting language that forms the basis of JavaScript. ECMAScript standardized by the ECMA International standards organization in the ECMA-262 and ECMA...
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.