Same as above. Let's always use the loop here.

Also, I think you want to construct the result array using a length explicitly, then fill it with converted values. (It looks like you pass 'array' to the constructor instead)