{"ScriptPreparationCode":"var posts = [];\r\nfor(let i = 0; i \u003C 1000000; i\u002B\u002B) {\r\n posts.push({\r\n upVotes: i,\r\n });\r\n}","TestCases":[{"Name":"reduce","Code":"let sum = 0;\r\nsum = posts.reduce((s, p) =\u003E s \u002B= p.upVotes, 0);","IsDeferred":false},{"Name":"for loop","Code":"let sum = 0;\r\nfor (let i = 0; i \u003C posts.length; i\u002B\u002B) {\r\n sum \u002B= posts[i].upVotes;\r\n}","IsDeferred":false},{"Name":"for each","Code":"let sum = 0;\r\nposts.forEach(element =\u003E {\r\n sum \u002B= element.upVotes;\r\n});","IsDeferred":false},{"Name":"for of","Code":"let sum = 0;\r\nfor(const post of posts) {\r\n sum \u002B= post.upVotes;\r\n}","IsDeferred":false}]}