How to get the min and max values in a set with Node.js

1 Answer

0 votes
const st = new Set([449, 998, 106, 238, 110, 573, 600]);

const min = Math.min(...st);
console.log(min);

const max = Math.max(...st);
console.log(max); 

 
    
    
    
    
/*
run:
    
106
998
    
*/

 



answered May 14, 2022 by avibootz

Related questions

1 answer 276 views
1 answer 261 views
1 answer 230 views
1 answer 282 views
1 answer 241 views
1 answer 259 views
...