Created
August 4, 2020 14:42
-
-
Save katepapineni/f4979d0d3362e6fab308f011ca89af3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const min = 4; | |
const max = 9; | |
const getNum = num => Math.min(max, Math.max(min, num)); | |
// What's the output? | |
console.log(getNum(6)); | |
console.log(getNum(3)); | |
console.log(getNum(10)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment