Numbered headings with CSS
With this incredibly easy way you can create numbered heading using just some lines of CSS.
counter CSS properties you can easily add numbers before any element.
counter-reset to the element that should reset the counter, in our case
counter(heading-counter), with a dot, to the pseudo selector
:before of all
h2. Also add the incrementer using
Which should give us a result looking like:
1. My first heading
2. My second heading
3. My third heading
The nullish coalescing operator
Learn how to fallback to a value only if the first provided value is undefined or null, using the the nullish coalescing operator.
How to remove duplicates in an Array using ES 2015