We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72ac5b6 commit 9292706Copy full SHA for 9292706
02-Fundamentals-Part-2/starter/challenge4.js
@@ -8,7 +8,6 @@ for (let i = 0; i < contas.length; i++){
8
}
9
10
11
-
12
let valorTotalDaConta = (contas, gorjeta)=> contas + gorjeta;
13
14
@@ -31,5 +30,18 @@ function calcAverage(arr){
31
30
32
33
console.log(`
34
-Média dos numeros contidos no array: ${calcAverage(contas)}
35
-`)
+Média dos numeros contidos no array: ${calcAverage(total)}
+`)
+
36
+// O PROFESSOR FEZ ASSIM
37
38
+let tips = []; // gorjetas
39
+let totals = []; //total da conta
40
41
+for (let i = 0; i < contas.length; i++){
42
+ let tip = totalGorjeta(contas[i]);
43
+ tips.push(tip); // totals de gorjetas
44
+ totals.push(tip + contas[i]); // total da conta
45
+}
46
47
+// a função ficou igual a que eu fiz.
0 commit comments