Use [].slice.call instead of for loop

Hi Raynos,

Thought this would nicely replace the for loop with the same result. I also added some tests.
Any reason why you preferred using the loop instead of this approach?

Thanks for considering my pull request
Olivier