Time for a nice little side project: let's build a link shortening service! Actually, more than giving you all the code to achieve it, we will go over the process of spec'ing and architecting one such service, following a given set of constraints.
Ranges are natively supported by a few (popular) programming languages. They allow for iteration over a defined space, while not having a linear increase in their memory footprint (all ranges always store a similar amount of data).
As sorting is a common operation on arrays, a more scalable and less error-prone strategy would be to define common compare functions. Let's build said compare functions!
A few years ago, ES6 introduced template literals, allowing among other things for multi-line strings, embedded expressions, and string interpolation. That means that the following snippets of code could be written as follow: