I guess the real bug is that the code to get the next accesses the original items array whereas the map function runs on a filtered array from which items may be removed.
Just don't have deleted items and all will be fine...
1 3Samuel
@samuel.fm
correct! solution is to use the 3rd arg of map, which will be the filtered array