Clamp Integers by various methods (version: 0)
Benchmark.js
Different methods to clamp an integer value to a range. First four are ternary, min/max, IF, and unary. Then those four when abstracted into functions.
Comparing performance of:Clamp from 0 to 255 using ternary vs Clamp from 0 to 255 using Min/Max vs Clamp from 0 to 255 with IF vs Clamp from 0 to 255 with unary && vs Clamp in arrow function with ternary vs Clamp in regular function with MinMax vs Clamp in arrow function with IF vs Clamp in regular function with unary