MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / clamp

Function clamp

assets/js/block_ninja.js:210–210  ·  view source on GitHub ↗
(num, min, max)

Source from the content-addressed store, hash-verified

208
209// Clamps a number between min and max values (inclusive)
210const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
211
212// Linearly interpolate between numbers a and b by a specific amount.
213// mix >= 0 && mix <= 1

Callers 1

tickFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected