Cristian Salcescu's Blog
June 14, 2023
Showing Any Playing Card From a Deck With Elm
Defining custom types, using records, mapping cards records to Unicode characters, and more
March 8, 2023
Generating Random Numbers and Strings

How would you generate a random number? What about a random string?
You may already know the built-in Math.random function. It generates a random number between 0 and 1, not including the 1 number.
Generating a Random NumberBelow is an example of using this utility.
const no = Math.random();console.log(no);
//0.9045660913804647
As you can notice the given result is a decimal number.
How can we generate an integer number in a specific interval?
To get a num...
February 24, 2023
State Management with React Hooks

The State Management with React Hooks book is available in kindle format.
State management is a common challenge when developing web applications.
This book explores state management with React Hooks by building several small applications.
Here are some of the things we will go through:
Understand what state isManaging form inputsDoing form validationEncapsulating the form state management and validation in custom hooksAdding, deleting, and editing items in list...October 2, 2022
Picking Playing Cards from a Deck with React Hooks
Maps of Unicode characters, creating and shuffling a deck, and more
September 30, 2022
How to Create and Delete a Git Branch

Some of the basic things we may need to do when working on a feature involved creating a development branch and then deleting that branch after merging all the changes.
Here is how we can do that.
Creating a Local BranchBelow is an example of creating a new branch new-dev-branch from the master branch.
git checkout -b new-dev-branch masterCreating a Remote BranchCreating a local branch does not mean that a branch is also created in the remo...
September 29, 2022
3 Ways to Render a List in Elm, Not All Available in React
September 25, 2022
Checking if Elements Exist in Large Arrays Using a Curried Utility Function
September 22, 2022
Removing Duplicates From an Array of Objects Using a Generic Utility
September 21, 2022
About the State Management of a Contenteditable Element in React
Controlled input, onInput event, e.target.innerHTML, and more
Good to Know About the State Management of a Contenteditable Element in React
Controlled input, onInput event, e.target.innerHTML, and more