Here you go! Used the code from the same Stack Overflow answer.
The first segment is for when you’re trying to convert one number (uses ID) and the second segment is for when you’re trying to convert a bunch of numbers (uses Class).
For both of them you need to have the function included beforehand.
Oh nice! I prefer yours to be honest! I’m new to JS and learned a few things reading your code! .textContent and Array.from() are new to me! Also very cool that you can name a constant in plural and then iterate through the plurality using the singular form of the constant’s name!
Indeed that forEach loop is pretty neat. I personnally use plural for array’s name and the singular for the respective single element of the array inside the forEach loop but you can use any name you want really. I just think it reads well and makes the code easier to understand.