Write _.clamp()
This commit is contained in:
parent
b99375d295
commit
534819ee57
1 changed files with 6 additions and 0 deletions
|
@ -1,2 +1,8 @@
|
|||
let _ = {}
|
||||
|
||||
/* --------------------------------------------------------------- clamp ---- */
|
||||
|
||||
_.clamp = (num, lower, higher) => Math.min(Math.max(num, lower), higher)
|
||||
|
||||
// Do not write or modify code below this line.
|
||||
module.exports = _
|
||||
|
|
Loading…
Reference in a new issue