They way you've done it seems fine, although if you're trying to find minimums of such large arrays in javascript I'd assume you're doing something wrong.
Javascript really isn't a great choice of language for big processing tasks; stuff like that should be moved away where possible (granted it isn't always an option).
Yeah I would not be doing it unless it was necessary. When I wrote that I was parsing a large file using javascript (from the client filesystem) and the round trip to the server would have been longer than this little function takes.
Javascript really isn't a great choice of language for big processing tasks; stuff like that should be moved away where possible (granted it isn't always an option).