-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
66 lines (52 loc) · 1.39 KB
/
app.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
let name = prompt("What is your name?");
let gender = prompt("What is your gender?");
if (gender !== "male" && "female") {
alert(" please enter male or female");
}
let age = prompt("What is your age?");
age <= 0
? alert("THERE IS SOME THING WRONGE. the is not your real age. ")
: confirm("if you want to skip welcoming message, you can press CANCEL");
gender == "female"
? alert("welcome Ms " + name)
: gender == "male"
? alert("welcome Mr " + name)
: alert("welcome " + name);
/* js2 branch*/
var array = [];
let codeingLove = prompt("Do you love coding?");
function codeLove() {
if (codeingLove == "yes" || codeingLove == "no") {
return codeingLove;
} else if (codeingLove == "") {
return "invalid";
} else {
return "";
}
}
let codeingLevel = prompt("Do you think coding is hard?");
function codeLevel() {
if (codeingLevel == "yes" || codeingLevel == "no") {
return codeingLevel;
} else if (codeingLevel == "") {
return "invalid";
} else {
return "";
}
}
let courseComplement = prompt(
"Do you intend to complet the coursee till the end ?"
);
function courseLevel() {
if (courseComplement == "yes" || courseComplement == "no") {
return courseComplement;
} else if (courseComplement == "") {
return "invalid";
} else {
return "";
}
}
array.push(codeLove());
array.push(codeLevel());
array.push(courseLevel());
console.log(array);