🔥 Use JavaScript’s new array.at():
array.at()
.at(0) → first item
.at(0)
.at(-1) → last item
.at(-1)
It also floors the index, which is handy for random items!
dogs.at(Math.random() * dogs.length)
Css Object Fit Cover For Aligning Images
Css Tips For Inconsistenly Sized Logos
State of JS 2025