Just a note to self: this is ok despite modification of the map during iteration, because the Object.keys() call fixes the result in an Array -- so the thing being iterated isn't the map itself, nothing's being concurrently modified.