{"ScriptPreparationCode":null,"TestCases":[{"Name":"klasicno","Code":"//klasicno\r\nvar korpa = [\r\n{ artikal: \u0027brasno\u0027, kolicina: 2, cena: 50},\r\n{ artikal: \u0027kvasac\u0027, kolicina: 5, cena: 10},\r\n{ artikal: \u0027mleko\u0027, kolicina: 3, cena: 90},\r\n{ artikal: \u0027voda\u0027, kolicina: 10, cena: 50},\r\n{ artikal: \u0027pivo\u0027, kolicina: 12, cena: 70}\r\n];\r\n\r\nvar racun = 0;\r\nfor (var i = 0; i \u003C korpa.length; i\u002B\u002B)\r\n racun \u002B= korpa[i].cena * korpa[i].kolicina;\r\n\r\nconsole.log(racun);","IsDeferred":false},{"Name":"funkcionalno","Code":"//funkcionalno\r\nvar korpa = [\r\n{ artikal: \u0027brasno\u0027, kolicina: 2, cena: 50},\r\n{ artikal: \u0027kvasac\u0027, kolicina: 5, cena: 10},\r\n{ artikal: \u0027mleko\u0027, kolicina: 3, cena: 90},\r\n{ artikal: \u0027voda\u0027, kolicina: 10, cena: 50},\r\n{ artikal: \u0027pivo\u0027, kolicina: 12, cena: 70}\r\n];\r\n\r\nvar racun = korpa.reduce((suma, lista) =\u003E suma \u002B lista.cena * lista.kolicina, 0);\r\n\r\nconsole.log(racun);","IsDeferred":false}]}