-1
Function getPeson () { const name1 = 'Vagner'; const Nome2 = 'Jessica';
Return name1, Nome2; }
console.log(getPeson());
-1
Function getPeson () { const name1 = 'Vagner'; const Nome2 = 'Jessica';
Return name1, Nome2; }
console.log(getPeson());
-2
You could concatenate if the case of being two string would be like this:
return nome1 + " " + nome2;
Or if you are Javascript ES6 you can also use Template strings
return `${nome1} ${nome2}`;
Browser other questions tagged javascript html css json function
You are not signed in. Login or sign up in order to post.
return
only returns a value, what is after the comma will not be returned. You can resolve this with arrayreturn [nome1, nome2];
– Guilherme Nascimento