JavaScript: Everyday Utilities and Recipes

Praveen Singh
1 min readAug 23, 2022
\

Table Of Content

· String
isString
Generate UUID
· Math
isNumber
Random Numbers
Reverse Number
· Array
Remove Duplicate values from an Array
Concat one array to another, without creating a new one.
Shuffle an array
Generate and Fill Array
· Object
Mixin
Object to Map
Map to Object

String

isString

Generate UUID

Math

isNumber

Random Numbers

Simple: Simple Random Number Generator (Good for most of the cases)

It’s important to understand that numbers generated by Math.random() are pseudorandom, which means they can be guessed or reverse engineered. They are not random enough for cryptography, lotteries, or complex modeling

Advanced: A true random number generator

Reverse Number

Array

Remove Duplicate values from an Array

Concat one array to another, without creating a new one.

Shuffle an array

Using Fisher-Yates shuffle Algorithm

Generate and Fill Array

Object

Mixin

Object to Map

Map to Object

--

--

Praveen Singh

I’m a Full Stack Engineer with a passion for Frontend Development and large-scale System Design.