-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8
More file actions
31 lines (25 loc) · 886 Bytes
/
8
File metadata and controls
31 lines (25 loc) · 886 Bytes
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
var s = 24;
var m = "hello world !";
var o = false;
var e = [3 , "december"];
console.log("the value of my variable s is:" + s);
console.log("the value of my variable m is:" + m);
console.log("the value of my variable o is:" + o);
console.log("the value of my variable e is:" + e);
console.log("the value of s variable is number");
console.log("the value of m variable is string");
console.log("the value of o variable is boolean");
console.log("the value of e variable is object");
var typeS = typeof (s);
var typeM = typeof(m);
var typeO= typeof(o);
var typeE= typeof(e);
if ((typeS == typeM) || (typeS == typeO) || (typeS == typeE)){
console.log("s has same type");
}else if ((typeM == typeO ) || (typeM == typeE)){
console.log("m has same type");
}else if ((typeO == typeE)){
console.log("o and e have the same type");
}else{
console.log("no similar types")
}