detect-hashchange-in-browser

How to detect location hash changes in Javascript

Introduction To detect the browser location hash changes in Javascript, there’s a web API event called hashchange. Which we can rely on to detect the change in…

add-property-to-object-conditionally

Conditionally add a new property to JS objects

Introduction Recently, I published an article about How to spread objects in Javascript conditionally. This article won’t have much difference from the previous one, it rather demonstrates…

How to conditionally spread objects in Javascript

How to conditionally spread objects in Javascript

Introduction In Javascript, If we want to spread an object into another one, we usually use the spread syntax operator (…) to do so. Like the following:…

dynamically-inject-js-css-in-webpage

How to dynamically inject JS/CSS into a webpage

Introduction Working with the new frontend tech stacks is fun, however, in some cases, it might be challenging there’s a need to host the frontend application in…

react-query-auto-pull

How to auto-pull data in React-Query

Introduction React-Query is a powerful tool for fetching/caching the data on the frontend side, yet working with React-Query might be a bit not straightforward, in this article…

js-sort-set-by-value

How to sort Javascript Set by value

The Set object lets you store unique values of any type, whether primitive values or object references. To sort a Set by value: Get an array of the Set’s entries using…

react-query-fetch-options

React-Query: How to fetch queries conditionally

Introduction React-Query is a powerful tool for fetching/caching the data on the frontend side, in this article we’re going to demonstrate how we can fetch the queries…

javascript-generators

Understand Javascript Generators

Javascript generators are under-appreciated, yet they are actually very useful and powerful, in this article, we will explore the basics and the power of javascript generators. Introduction…

Javascript Intl.RelativeTimeFormat formatting

How to format dates with Intl.RelativeTimeFormat

The idea of Intl.RelativeTimeFormat is that it gives the ability to format to create an instance of relative time format function, with some pre defined settings or…