in reply to Re: How to get the index of smallest whole number in an array? (Simplified)
in thread How to get the index of smallest whole number in an array?
all negatives -- returns undefNo you get 0 with all negatives, since the first thing reduce does is set $a to the first value in the list. Though there is more than one way to solve this, I didn't find a one that doesn't involve re-checking $a on each iteration.
|
|---|