+ 3

Can someone help me out with this?

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

21st Sep 2018, 8:32 AM
Waseem-Ahmad Ebrahim
5 Answers
+ 3
Waseem-Ahmad Ebrahim 👍 var names = [prompt(), prompt()] var len = names.length; var arr = new Array(); for (let i=0; i<len; i++) { arr.push(' '+names[i]); arr.reverse(names[i]); } console.log(arr); https://code.sololearn.com/WS4HaHM74psO/?ref=app
21st Sep 2018, 9:00 AM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar
+ 1
Thanks man, that helps a lot.
21st Sep 2018, 9:10 AM
Waseem-Ahmad Ebrahim
0
Give me your attempt, I would help you from there.
21st Sep 2018, 8:48 AM
CalviŐ˛
CalviŐ˛ - avatar
0
I wasn't sure if mine was correct
21st Sep 2018, 8:55 AM
Waseem-Ahmad Ebrahim
0
:)
21st Sep 2018, 10:03 PM
Tigran Tadevosyan
Tigran Tadevosyan - avatar