RSSAmplifier

Blog

Dmitri Pavlutin Blog

Dmitri Pavlutin Blog is a place to learn about JavaScript, CSS, React, Vue and more on Frontend development

dmitripavlutin.comRSS feed ↗177 posts

Latest posts

Pure Functions in JavaScript: A Beginner's Guide

A pure function always returns the same value for the same arguments and produces no side effects.

Record Type in TypeScript: A Quick Intro

Record type simplifies typing objects in TypeScript. Let's see how you can benefit from it.

How to Write Comments in React: The Good, the Bad and the Ugly

{/* Comment */} is the usual way to write comments in React. But there are 2 better ways to comment you just have to know.

4 Ways to Create an Enum in JavaScript

An enum is a set of named constants. The plain object, frozen object, proxied object or class-based are the 4 ways to create enums in JavaScript.

React forwardRef(): How to Pass Refs to Child Components

React forwardRef() is a tool for passing refs to child components. Discover how to use it with ease in this comprehensive tutorial.

TypeScript Function Types: A Beginner's Guide

Are you struggling to understand TypeScript function types? Look no further! This comprehensive guide covers everything you need to know.

How to Use v-model to Access Input Values in Vue

How to use v-model to bind form input elements like text input, textarea, select, checkbox, radio in Vue.

Mastering Vue refs: From Zero to Hero

ref() is a Vue composition API function that creates refs: small reactive values.

Environment Variables in JavaScript: process.env

How to access environment variables in JavaScript using process.env and expose them to the browser runtime using bundlers like Vite and webpack.

5 Must-Know Differences Between ref() and reactive() in Vue

What are the main differences between ref() and reactive()? And when to use one or another?

How to Destructure Props in Vue (Composition API)

How to correctly destructure props object in a Vue component while maintaining the reactivity.

Triangulation in Test-Driven Development

How to use triangulation technique to guide the creation of generic code in test-driven development.

How to Use nextTick() in Vue

nextTick(callback) executes the callback when the DOM has been updated.

Programming to Interface Vs to Implementation

How programming to an interface can make your application easier to change in the future.

A Smarter JavaScript Mapper: array.flatMap()

array.flatMap() is a method on the array that let's you map elements a littler smarter.

Array Grouping in JavaScript: Object.groupBy()

Object.groupBy() and Object.groupByToMap() methods let you group an array by certain criteria.

How to Access ES Module Metadata using import.meta

How to access the meta information (module URL, etc.) of an ES module in JavaScript.

JSON Modules in JavaScript

How to import JSON data directly into an ES module.

How to Trim Strings in JavaScript

How to trim (aka remove whitespaces and line terminators) from strings in JavaScript.

TypeScript Function Overloading

Function overloading in TypeScript lets you define functions that can be called in multiple ways.

How to Debounce and Throttle Callbacks in Vue

How to debounce and throttle watchers and event handlers in Vue components.

How to Show/Hide Elements in Vue

How to use v-if, v-show and :class to show/hide elements in Vue.

Sparse vs Dense Arrays in JavaScript

What's the difference between sparse and dence arrays in JavaScript

How to Fill an Array with Initial Values in JavaScript

How to initialize an array with initial values in JavaScript using array.fill(), Array.from(), or array.map()

Covariance and Contravariance in TypeScript

Covariance and contravariance are the concepts behind the subtyping of composable types.

What are Higher-Order Functions in JavaScript?

The higher-order function accept as arguments or return other functions.

How to Use TypeScript with React Components

How to use TypeScript to type React components: validate props, mark props as optional.

Index Signatures in TypeScript

Index signatures in TypeScript let's you annotate objects of unknown structure.

How to Use React useReducer() Hook

How to use useReducer() hook to manage complex state: initial state, action object, dispatch, reducer in React.

unknown vs any in TypeScript

What is the difference between unknown and any types in TypeScript.

A Guide to React Context and useContext() Hook

The React context provides data to components no matter how deep they are in the components hierarchy.

How to Use Promise.any()

How to use the Promise.any() to get the first fulfilled promise from an array of promises.

2 Ways to Remove a Property from an Object in JavaScript

How to remove properties from an object in JavaScript using the delete operator or object destructuring with rest syntax.

'return await promise' vs 'return promise' in JavaScript

Is there any difference between using 'return await promise' and 'return promise' in asynchronous JavaScript functions?

How to Use Promise.allSettled()

How to use Promise.allSettled() to perform parallel async operations and collect the promises statuses into an array.

How to Use fetch() with JSON

How to use fetch() API to load and post JSON data.

JavaScript Promises: then(f,f) vs then(f).catch(f)

What's the difference between promise.then(fn, fn) and promise.then(fn).catch(fn) when using JavaScript promises?

What is a Promise in JavaScript?

The post that I had wanted to read myself to understand promises.

How to Use Promise.all()

How to use Promise.all() to perform parallel async operations in a fail-fast manner.

A Simple Guide to Component Props in React

In this guide you'll find what are component props in React and how to use them.

Don't Stop Me Now: How to Use React useTransition() hook

How to speed up UI updates by prioritizing updates using React useTranstion() hook.

A Simple Explanation of JavaScript Variables: const, let, var

How to declare, initialize, assign and read JavaScript variables using const, let and var statements.

ES Modules Dynamic Import

How to use import(pathToModule) to dynamically import ES (ECMAScript) modules in JavaScript.

How to Memoize with React.useMemo()

How and when to use React.useMemo() hook to improve the performance of React components.

How to Cleanup Async Effects in React

How to correctly cleanup async side-effects in React when the component unmounts or updates.

Why Math.max() Without Arguments Returns -Infinity

What is the reason that Math.max() utility function when being called without arguments returns -Infinity.

How to Debounce and Throttle Callbacks in React

How to debounce and throttle callbacks in React using useCallback() and useMemo() hooks.

Don't Confuse Function Expressions and Function Declarations in JavaScript

What are the differences between function declarations and function expressions in JavaScript.

How to Use ES Modules in Node.js

How to Use ES (ECMAScript) Modules in Node.js environment.

Solving a Mystery Behavior of parseInt() in JavaScript

Solving a mystery of how parseInt() parses small float numbers in JavaScript.