Activity › Forums › Adobe After Effects Expressions › Obtaining the minimum value of an array
-
Obtaining the minimum value of an array
Posted by Jamie Bradshaw on November 18, 2014 at 5:04 pmHi all.
Is there a simple/efficient way to find the minimum value stored in an array?
Cheers,
JamieJimJam•Graphics
https://www.jimjamgraphics.com/Dan Ebbertsreplied 11 years, 5 months ago 3 Members · 5 Replies
-
5 Replies
-
Dan Ebberts
November 18, 2014 at 5:56 pmThis seems to work:
myArray = [5,4,3,2,1,0,-1,0,-3.3,2,3,4,5];
myMin = Math.min.apply(Math,myArray);Dan
-
Xavier Gomez
November 18, 2014 at 8:11 pmDan,
i tested this and obtained 4.
Can it have something to do with the AE version (CS5.5 for me)?Xavier.
-
Dan Ebberts
November 18, 2014 at 8:29 pmInteresting. Appears to work for CS6, breaks at CS5.5. Maybe it’s the version of JavaScript supported.
-
Xavier Gomez
November 18, 2014 at 8:42 pmOK thank you.
I’m surprised, i thought that the javascript implementation was the same across all versions, with only the object model growing from time to time.
Xavier.
Reply to this Discussion! Login or Sign Up