+ 1

I want to make a program that it takes a name then it writes the first word of the name as a upperCase() with js

how can I write that?

11th Aug 2018, 10:01 AM
Sina
Sina - avatar
4 Réponses
+ 1
Perhaps you mean convert first letter instead of first word. var name = prompt("Enter your full name", "iran sina"); var words = name.split(""); words[0] = words[0].toUpperCase(); name = words.join('') alert("Your name is " + name); https://code.sololearn.com/WltG3DHjEcy4/?ref=app
11th Aug 2018, 11:48 AM
Calviղ
Calviղ - avatar
+ 2
var name = prompt("Enter your full name", "iran sina"); var words = name.split(" "); words[0] = words[0].toUpperCase(); name = words.join(' ') alert("Your name is " + name); https://code.sololearn.com/Wfk6lZY1MUHp/?ref=app
11th Aug 2018, 10:39 AM
Calviղ
Calviղ - avatar
+ 1
I taged
11th Aug 2018, 10:10 AM
Sina
Sina - avatar
0
Oh thanks Icould to make this program before but my wrong thins was this that I used for and I didn't use of split(""); thank you so much:)
11th Aug 2018, 6:36 PM
Sina
Sina - avatar