Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/processing/p5.js
/ findMax
Function
findMax
src/math/calculation.js:624–630 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
622
*/
623
fn.max =
function
(...args) {
624
const
findMax = arr => {
625
let
max = -Infinity;
626
for
(
let
x of arr) {
627
max = Math.max(max, x);
628
}
629
return
max;
630
};
631
632
if
(args[0] instanceof Array) {
633
return
findMax(args[0]);
Callers
1
calculation
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected