Daily Shaarli

All links of one day in a single page.

July 20, 2021

"Images are hard", Chris Coyier (@chriscoyier)

Putting images on websites is incredibly simple, yes? Actually, yes, it is. You use <img> and link it to a valid source in the src attribute and you’re done. Except that there are (counts fingers) 927 things you could (and some you really should) do that often go overlooked. Let’s see…

Looping over Arrays: `for` vs. `for-in` vs. `.forEach()` vs. `for-of`

As we have seen, the for-of loop beats for, for-in, and .forEach() w.r.t. usability.

Any difference in performance between the four looping mechanisms should normally not matter. If it does, you are probably doing something very computationally intensive and switching to WebAssembly may make sense.