PostsBlogReposAbout
Samuel5 May 2024
spot the bug
function getItemsWithNext() {
  return items
    .filter(item => {
      if (isDeleted(item)) {
        return false
      }
      return true
    })
    .map((item, i) => {
      const next = items[i + 1]
      return {
        item,
        next,
      }
    })
} 18 1 32
Christopher Stevens5 May 2024
The i in the .map() may not quite line up in the out of scope items will it… :) 🐞
1 3
Samuel
@samuel.fm
Yep ;)
5 May 2024 at 2:18 amView on Bluesky