-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.js
More file actions
124 lines (77 loc) · 2.92 KB
/
Copy pathhello.js
File metadata and controls
124 lines (77 loc) · 2.92 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'use strict'
// exercise 1
console.log('-------------exercise 1----------------')
console.log('MaRHBA Donia ', 'Arabic');
console.log('ciao mondo ', 'italian');
console.log('Hallo wereld ', 'Nederlands');
console.log('Hello worold ', 'English');
// exercise 2
console.log('-------------exercise 2----------------')
console.log('I m Awesome');
// exercise 3
console.log('-------------exercise 3----------------')
let x ;
console.log('x will be undefined');
console.log(x);
x = 123 ;
console.log('x will be 123');
console.log(x);
// exercise 4
console.log('-------------exercise 4----------------')
let y = 'I am a variable';
console.log('y will be am a variable ');
console.log(y);
// exercise 5
console.log('-------------exercise 5----------------')
const z = 7.25 ;
console.log(z) ;
const a = Math.round(z);
console.log(a) ;
if (z > a){console.log(z);}
else{console.log(a);}
// exercise 6
console.log('-------------exercise 6----------------')
let pets = [];
console.log('the value of variable will be [Nothing in this aaray]');
console.log(pets);
pets = ['cat','sheep','hamster','chicken','horse'];
console.log(pets);
pets.push('Dog');
console.log(pets);
// exercise 7
console.log('-------------exercise 7----------------')
let myString = 'this is a test string for calculating it s length!';
console.log(myString);
console.log(myString.length);
// exercise 8
console.log('-------------exercise 8----------------')
let x8 = 9;
console.log('the value of x8:' + x8 );
let y8 = 'hello';
console.log('the value of y8 : ' + y8);
let z8 = 3.42;
console.log('the value of z8 : ' + z8);
let k8 = [32 , 'age'];
console.log('the value of k8 : ' + k8);
console.log('the value of x8:' + x8 + typeof(x8));
console.log('the value of y8 : ' + y8 + typeof(y8)) ;
console.log('the value of z8 : ' + z8 + typeof(z8)) ;
console.log('the value of k8 : ' + k8 + typeof(k8));
if(typeof x8 == typeof y8){console.log(x8 + ' and ' + y8 + ' have same type.')}
else{console.log(x8 + ' and ' + y8 + ' dont have same type.')}
if(typeof x8 == typeof z8){console.log(x8 + ' and ' + z8 + ' have same type.')}
else{console.log(x8 + ' and ' + z8 + ' dont have same type.')}
if(typeof x8 == typeof k8){console.log(x8 + ' and ' + k8 + ' have same type.')}
else{console.log(x8 + ' and ' + k8 + ' dont have same type.')}
if(typeof y8 == typeof z8){console.log(y8 + ' and ' + z8 + ' have same type.')}
else{console.log(y8 + ' and ' + z8 + ' dont have same type.')}
if(typeof y8 == typeof k8){console.log(y8 + ' and ' + k8 + ' have same type.')}
else{console.log(y8 + ' and ' + k8 + ' dont have same type.')}
if(typeof z8 == typeof k8){console.log(z8 + ' and ' + k8 + ' have same type.')}
else{console.log(z8 + ' and ' + k8 + ' dont have same type.')}
// exercise 9
console.log('-------------exercise 9----------------')
var num = 6 ;
var num = num % 3 ;
console.log("6 % 3 = 0 " );
console.log('% is the reminder result of dividing tow numbers');