{"ScriptPreparationCode":"var listOfObjects = Array.from({length: 100}).map((_, i) =\u003E ({ id: i, quantity: Math.round((Math.random() * i) \u002B 1), price: Number(((Math.random() * i) \u002B 1).toFixed(2)) }));","TestCases":[{"Name":"Get the total of all items using the reduce","Code":"listOfObjects.reduce((acc, item) =\u003E acc \u002B (item.quantity * item.price), 0);","IsDeferred":false},{"Name":"Get the total of all items using map","Code":"let total = 0;\r\nlistOfObjects.map(item =\u003E total \u002B= (item.quantity * item.price));","IsDeferred":false}]}