Blog, page 3
15 January 2021
Have you ever tried to see how many times a letter or a word appears in a string? Or how many tim...
14 January 2021
To format an array of numbers as ordinal numbers, we need to properly add the suffixes -st, -nd, ...
13 January 2021
Formatting a number as currency in JS is easy. We can use Intl.NumberFormat(), and style it as cu...
12 January 2021
In JS, we can add a comma as thousands separator using the toLocaleString() method, or using Intl...
11 January 2021
To get a random, three-member sub-array from an array of items, we need to use the splice, Math.r...
10 January 2021
We have a web page with a script tag. That script tag holds an array of various Bootstrap 4 CSS c...
09 January 2021
We can easily whip up our own password generator in vanilla JS. This tutorial shows you how to do...
08 January 2021
Randomly reordering members of a JavaScript array might seem an easy task, but it can also be dif...
07 January 2021
Math.random() gives us a range between 0 (inclusive) and 1 (exclusive). But how do we use this me...
Using the conditional (ternary) operator, we are able to easily return, at random, either a boole...