-1
Good evening Everyone,
I would like to help with the following code:
function tamanhoNomeCompleto(nome, sobrenome){
return (nome + " " + sobrenome).length;
}
tamanhoNomeCompleto("Lucas", "Paixao");
console.log(tamanhoNomeCompleto.length + " digitos");
With this code, the answer I get is "2 digits", but wouldn’t it be right for me to receive "12 digits"? Can anyone help me with that question? Thanks for your help.
Att, Lucas
The code is running perfectly. Its function returns the LENGTH of what was passed, which is 12. Next you do console.log. length of 12 returned. That is "2". Try decreasing the strings so that the length is 9, for example. The length of 9 is 1.
– Bacco
This is asked almost every day here https://answall.com/search?q=tamanhoNomeCompleto.
– Maniero