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.
In reply to Re^2: How to get the index of smallest whole number in an array? (Simplified)
by Eily
in thread How to get the index of smallest whole number in an array?
by sohamsg90
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |