{"ScriptPreparationCode":"var number = Math.random() * 1000;\r\nvar min = Math.random() * 300;\r\nvar max = Math.random() * 1200;\r\n\r\nfunction ternaryClamp(number, min, max) {\r\n return number \u003E max ? max : (number \u003C min ? min : number);\r\n}\r\nfunction ternaryMin(number, min) {\r\n return number \u003C min ? number: min;\r\n}\r\nfunction ternaryMax(number, max) {\r\n return number \u003E max ? number: max;\r\n}","TestCases":[{"Name":"Math.min/max","Code":"Math.min(Math.max(number, min), max)","IsDeferred":false},{"Name":"Math.min","Code":"Math.min(number, min)","IsDeferred":false},{"Name":"Math.max","Code":"Math.max(number, max)","IsDeferred":false},{"Name":"Ternary clamp","Code":"ternaryClamp(number, min, max);","IsDeferred":false},{"Name":"Ternary min","Code":"ternaryMin(number, min)","IsDeferred":false},{"Name":"Ternary max","Code":"ternaryMax(number, max)","IsDeferred":false},{"Name":"Ternary clamp inlined","Code":"number \u003E max ? max : (number \u003C min ? min : number)","IsDeferred":false},{"Name":"Ternary min inlined","Code":"number \u003C min ? number: min","IsDeferred":false},{"Name":"Ternary max inlined","Code":"number \u003E max ? number: max","IsDeferred":false}]}