π₯ 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