From 534819ee572398b01b3e56bb5c94f3b5c260d4c1 Mon Sep 17 00:00:00 2001 From: marleyrae Date: Tue, 27 Jun 2023 18:13:07 -0700 Subject: [PATCH] Write _.clamp() --- lodash/_.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lodash/_.js b/lodash/_.js index a79693a..ba9cb66 100644 --- a/lodash/_.js +++ b/lodash/_.js @@ -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 = _