File tree Expand file tree Collapse file tree 2 files changed +109
-0
lines changed
js-core/classworks/classwork-3 Expand file tree Collapse file tree 2 files changed +109
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > Class work 3</ title >
6+ </ head >
7+ < body >
8+ < script src ="src/main.js "> </ script >
9+ </ body >
10+ </ html >
Original file line number Diff line number Diff line change 1+ //alert(`hello world`);
2+ //prompt(`What is your name: `, `Your Name`);
3+ //confirm(`Do you like it: `);
4+
5+ // TASK 1
6+
7+ //let firstValue = Number(prompt('Enter first number'));
8+ //let secondValue = Number(prompt('Enter second number'));
9+ //let sum = firstValue + secondValue;
10+ //alert(sum);
11+
12+ //if(10 === 10) {
13+ // console.log('10');
14+ //} else if (null != undefined) {
15+ // console.log('null != undefined');
16+ //} else {
17+ // console.log(`nothing`);
18+ //}
19+
20+ // TASK 2
21+
22+ //let query = Number(prompt(`Enter a number: `));
23+ //if (query > 150) {
24+ // console.log(`Тайланд`);
25+ //} else if (query <= 100) {
26+ // if(query < 0) {
27+ // console.log(`Enter positive number`);
28+ // }
29+ // else {
30+ // console.log(`Бали`);
31+ // }
32+ //} else {
33+ // console.log(`Италия`);
34+ //}
35+
36+ // TASK 3
37+
38+ //if (1 > 3) {
39+ // if (1 > 3) {
40+ // console.log(`1`);
41+ // } else if (1 > 3) {
42+ // console.log(`2`);
43+ // } else {
44+ // console.log(`3`);
45+ // }
46+ //} else if (1 > 3) {
47+ // if (1 > 3) {
48+ // console.log(`4`);
49+ // } else if (1 > 3) {
50+ // console.log(`5`);
51+ // } else {
52+ // console.log(`6`);
53+ // }
54+ //} else {
55+ // if (1 === 2) {
56+ // console.log(`7`);
57+ // } else if (1 === 2) {
58+ // console.log(`8`);
59+ // } else {
60+ // console.log(`The end`);
61+ // }
62+ //}
63+
64+ // TASK 4
65+
66+ function task4 ( ) {
67+ let checkNumber = 1 ;
68+ let firstValue = Number ( prompt ( 'Enter first number' ) ) ;
69+
70+ if ( isNaN ( firstValue ) ) {
71+ return alert ( `First prompt is NaN` ) , task4 ( ) ;
72+ }
73+
74+ let secondValue = Number ( prompt ( 'Enter second number' ) ) ;
75+
76+ if ( isNaN ( secondValue ) ) {
77+ return alert ( `Second prompt is NaN` ) , task4 ( ) ;
78+ }
79+
80+ let sum = firstValue + secondValue ;
81+
82+ alert ( sum ) ;
83+ }
84+
85+ task4 ( ) ;
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
You can’t perform that action at this time.
0 commit comments