Spread Operator in React

These three dots are called the spread syntax or spread operator. The spread syntax is a feature of ES6, and it’s also used in React. Spread syntax allows you to deconstruct an array or object into separate variables. Even though the syntax doesn’t look particularly meaningful when you first encounter it, spread syntax is super useful. Spread syntax (…) allows an… Continue reading Spread Operator in React

Difference between parseISO(string) and new Date(string)?

The difference lies in the way they handle parsing of date strings and in their behavior regarding the interpretation of time zones. parseISO(string): This function is typically used in libraries like date-fns for parsing ISO 8601 formatted strings into JavaScript Date objects. ISO 8601 format includes the date and time in a standardized format. parseISO… Continue reading Difference between parseISO(string) and new Date(string)?

What’s New in Next.js 14.1: ?

Improved Self-Hosting: New documentation and custom cache handler. Turbopack Improvements: 5,600 tests passing for next dev –turbo. DX Improvements: Improved error messages, pushState and replaceState support. Parallel & Intercepted Routes: 20 bug fixes based on your feedback. Improved Self-Hosting We’ve heard your feedback for improved clarity on how to self-host Next.js with a Node.js server,… Continue reading What’s New in Next.js 14.1: ?

What’s the purpose of if (typeof window !== ‘undefined’) in Nextjs?

The if (typeof window !== ‘undefined’) check is a common pattern in JavaScript, especially in the context of web development with libraries like React and Next.js. This condition is used to determine whether the code is running in a browser environment or on the server. Here’s an explanation of how it works: typeof window: The… Continue reading What’s the purpose of if (typeof window !== ‘undefined’) in Nextjs?

Image compression libraries in Next.js

Next.js itself does not provide specific image compression libraries, as it’s more focused on server-side rendering, routing, and other aspects of web development. However, you can use third-party libraries within your Next.js project for image compression. Here are a few popular JavaScript libraries for image compression: image-size: A simple library to get the dimensions of… Continue reading Image compression libraries in Next.js

Category Hierarchy Display

Not valid content,for testing Purpose Category Hierarchy Display Verify that the LHS of the PLP page displays the category hierarchy as per the design. Ensure that the hierarchy is clear, with parent and child categories distinguishable. Price Range Display Confirm the price range is visible on the LHS of the PLP page as per the… Continue reading Category Hierarchy Display

Install Node.js 20.0.0 version with nvm.

Install nvm: Open a terminal. Run the following command to install nvm: Copy code curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash This command installs nvm using the installation script from the official GitHub repository. If you encounter any issues or if the version has been updated, please check the nvm GitHub repository for the latest installation instructions.… Continue reading Install Node.js 20.0.0 version with nvm.

Methods and Event Handling in Vue.js

In Vue.js, methods are functions defined within the methods option of a component. They provide a way to encapsulate logic and functionality that can be called in response to events or other triggers. https://v1.vuejs.org/guide/events.html