{"ScriptPreparationCode":"$canvas = document.getElementById(\u0027canvas\u0027);\r\n$context = $canvas.getContext(\u00272d\u0027);\r\n$context.clearRect(0, 0, 800, 300);\r\n\r\n$iterations = 500;","TestCases":[{"Name":"Using a global context variable","Code":"for (let i=0; i\u003C$iterations; \u002B\u002Bi) {\r\n $context.fillStyle = \u0027rgba(100,150,200,0.9)\u0027;\r\n $context.fillRect(0, 0, 1, 1);\r\n}","IsDeferred":false},{"Name":"Invoking getContext() before every fillRect()","Code":"for (let i=0; i\u003C$iterations; \u002B\u002Bi) {\r\n const context = $canvas.getContext(\u00272d\u0027);\r\n context.fillStyle = \u0027rgba(100,150,200,0.9)\u0027;\r\n context.fillRect(0, 0, 1, 1);\r\n}","IsDeferred":false}]}