Basic JavaScript - Passing Values to Functions with Arguments

Preciso de ajuda. Fiz o código, mas o erro permanece. Erro: Você deve ligar functionWithArgs com dois números depois de defini-lo.

function functionWithArgs(a, b) {

console.log(a + b);

}

functionWithArgs(1 + 2);

functionWithArgs(7 + 9);

Já procurei no google mas não consigo resolver.

Are you passing two arguments, or just one? Use another console.log and check what the parameters a and b hold. And check the example code, it shows you the proper syntax to send two arguments.

Você está passando dois argumentos ou apenas um? Use outro console.log e verifique o que os parâmetros aeb mantêm. E verifique o código de exemplo, ele mostra a sintaxe adequada para enviar dois argumentos.

Então podemos chamar o testFun dessa forma: testFun("Hello", "World");

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.