An adventure in sparse arrays

1 · Remy Sharp · June 26, 2018, 2:28 p.m.
I offered to coach JavaScript recently, and an exercise I dreamt up was to implement every array (prototype) method, and write tests that they work. Since I'd come down with tonsillitis which apparently comes with a full on bedridden fever, I thought I'd have a go myself. And I learnt a few things along the way. Today, I wanted to share the swiss cheese wonder of sparse arrays! (see what I did there? 🧀)...