KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have used the following expression to retrieve the index of the smallest number in a vector. However, I would like to avoid the use of .indexOf (for efficiency reasons and maybe numeric precision, although I guess the numbers are implicitly converted to strings). (.indexOf [1 2 3 4 0 5] (reduce #(if (< %1 %2) %1 %2) [1 2 3 4 0 5] )) Would it be possible to do it differently using reduce?
Tags (comma-separated)
Save Edits
Cancel