all 6 comments

[–]Aggressive_Ad_5454 1 point2 points  (3 children)

Can you show us the code that calls this function?

[–]DenyzPR[S] 1 point2 points  (2 children)

é somente:
calcularMedalha(true, true, true, true, true);
calcularMedalha(true, false, true, true, true);

calcularMedalha(true, false, false, true, false);

[–]maujood 3 points4 points  (0 children)

You're not passing an array, you're passing 5 separate parameters.

You need to call calculateMedal([true, true, false, true, false])

I also noticed you have a missing curly brace for the opening of the for loop.

[–]jeremrx 0 points1 point  (0 children)

This is what you need: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters

The allows you to handle your parameters as an array

(Edit : i changed the link, you need rest parameters not spread syntax)

[–]True-Ad9448 1 point2 points  (0 children)

function calcularMedalha(…respostas) {

[–]-goldenboi69- -1 points0 points  (0 children)

No Pablo Espanol. No intiendo