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 268 views
1 answer 253 views
1 answer 227 views
1 answer 274 views
1 answer 237 views
1 answer 254 views
...