Pergunta
What is the output of the following program Assume the user enters "Florence' then 'Fernandez'.) console .log(wholeName); Fernandez Florence Florence Fernandez FlorenceFernandez Florence Fernandez
Solução
Verification of experts
4.3281 Voting
NeusaElite · Tutor por 8 anos
Responder
The output of the following program would be "Florence Fernandez".<br /><br />Here's the breakdown of how the program works:<br /><br />1. The `console.log(wholeName);` line is used to print the value of the `wholeName` variable to the console.<br />2. The user is prompted to enter the first and last names, which are stored in the `firstName` and `lastName` variables, respectively.<br />3. The `wholeName` variable is assigned the value of the `firstName` and `lastName` variables concatenated together with a space in between, using the `+` operator.<br />4. The `console.log(wholeName);` line is executed, which prints the value of the `wholeName` variable to the console. Since the `wholeName` variable is assigned the value of the `firstName` and `lastName` variables concatenated together with a space in between, the output would be "Florence Fernandez".
Clique para avaliar: