Indeed, this is very interesting and you had the right guess on my intentions
In fact I obviously want to build an collection, as an array in my case. By the way, why would I prefer an object as you do? I'm pretty new to JSing, and I've seen that many times, but couldn't figure out why by myself.
Another question: it looks like there's an unused 'm' parameter in the callback sent to replace (I didn't know this was possible). Is it the typical mandatory prototype for the function?
Anyway, thanks a lot for your help