Guys help me with JavaScript assignment | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Guys help me with JavaScript assignment

Write a javascript program that asks the user to enter his or her first name and then last name, and then constructs, stores, and displays a third string consisting of the user’s last name followed by a comma, a space, and first name. Use string objects and methods from the string header file. A sample run could look like this: Enter your first name: Paul Enter your last name: Smith Here’s the information in a single string: Smith, Paul

16th Sep 2019, 9:36 AM
herolled
herolled - avatar
4 Answers
+ 1
var firstName = prompt("Please enter your first name"); var lastName = prompt("Please enter your last name"); var output = lastName + ', ' + firstName; alert(output);
16th Sep 2019, 7:42 PM
Nathan Freelander
Nathan Freelander - avatar
0
Raz
24th Sep 2019, 11:19 AM
Hndia Omer
Hndia Omer - avatar
0
Naz
24th Sep 2019, 11:20 AM
Hndia Omer
Hndia Omer - avatar
0
Nazraz
24th Sep 2019, 11:20 AM
Hndia Omer
Hndia Omer - avatar