-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrings.js
37 lines (27 loc) · 873 Bytes
/
strings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// // let Message = "Hello";
// // alert(Message + " there, " + Name);
// let yourName = prompt("enter your name please!");
// let message = prompt("enter a message here!");
// let messageUnder20 = message.slice(0, 20);
// console.log(message);
// alert(
// "Hello " +
// yourName +
// " you have written " +
// message.length +
// " letters " +
// " you have left " +
// (280 - message.length) +
// " out of 280 letters"
// );
// alert(
// "your massage is " + messageUnder20 + " and it will be cut if its to long!"
// );
// short version
// alert(prompt("your massage is ").slice(0, 20));
// using upper case and slice together and lenght
let yourName = prompt("enter your name please!");
yourUpperName =
yourName.slice(0, 1).toUpperCase() +
yourName.slice(1, yourName.length).toLowerCase();
alert("Hello " + yourUpperName);