function range(num, min, max) { return Math.min(Math.max(num, min), max); } const a = range(1,10,20) console.log(a) console.log(Math.max(1,10)) console.log(Math.min(10,20)) console.log(Math.max.apply(this, [1,3,5,7,9,])) console.log(Math.min.apply(this, [2,4,6,8,]))