{"ScriptPreparationCode":"function clamp(number, min, max) {\r\n return Math.min(Math.max(number, min), max);\r\n}\r\n\r\nfunction clamp2(number, min, max) {\r\n // Operators are faster than Math.min/max. See http://jsperf.com/number-constrain\r\n return (number \u003C min) ? min : ((number \u003E max) ? max : number);\r\n}\r\n\r\nvar min = 100;\r\nvar max = 200;","TestCases":[{"Name":"clamp_50","Code":"clamp(50, min, max);","IsDeferred":false},{"Name":"clamp2_50","Code":"clamp2(50, min, max);","IsDeferred":false},{"Name":"clamp_150","Code":"clamp(150, min, max);","IsDeferred":false},{"Name":"clamp2_150","Code":"clamp2(150, min, max);","IsDeferred":false}]}