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 153 views
1 answer 154 views
1 answer 131 views
1 answer 175 views
1 answer 146 views
1 answer 156 views
...