Using closure scope in `data.sort()`