November 2022

How to sort a Set in JavaScript

How to sort a Set in JavaScript

  • November 26, 2022

ES6 introduced the set data structure in JavaScript. But sets are not ordered abstract data structures. So there is no .sort() property available on them. To sort a Set in JavaScript, we need to convert it into an array first. Since arrays are sortable, we will then sort them, and...

Debugging CSS scroll using one simple style

Debugging CSS scroll using one simple style

  • November 18, 2022

I have been doing a lot of complicated front-end work off lately and that always brings me back to the class conundrum of which element was adding a horizontal/vertical scroll to my page/elements. Debugging CSS scroll is a pain that I have felt too many times now and I always...

CSS :has a parent selector now

CSS :has a parent selector now

  • November 12, 2022

CSS now includes a :has selector that allows us to apply styles on the basis of what is happening inside an element. Often referred to as a parent seletor, the :has() function allows us to achieve this and more. Let us take a look at this relative selector. It only...