Still using the traditional way to access items from the right end of an array? ๐ซฅ
Try the new .at() method. This can be used to access elements from an array similar to [] notation, but negative values can be used to access items from the right end
#javascript#frontend
Explanation โจ
The important part is the second selector. This is possible due to a recent addition to CSS, the :has pseudo selector. This helps to select a parent when any of its children matches a particular criteria.
Using a combination of :has() pseudo selector and the :not() pseudo selector, we can select the profiles that are not hovered, only when one of the profiles is hovered
My single most top tip for #code quality is this:
if (...)
if (...)
if (...)
๐โ
๐ธ Avoid nesting code more than three levels deep ๐ธ
Once you get to three or four levels, it's probably time to break down your code into smaller units! ๐ค