-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUntitled.js
69 lines (55 loc) · 1.27 KB
/
Untitled.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
67
68
let a = {
name: 'reza'
}
let b = {
name: 'reza'
}
console.log(a===b)
// let theme = {
// dark:{
// background:'#333',
// foreground:'#ff4',
// fontColor:'#f5f5f5'
// },
// light:{
// background:'#f5f5f5',
// foreground:'#2060ff',
// fontColor:'#333'
// }
// }
// console.log(theme.dark===theme.light)
let theme = {
dark:{
background:'#333',
foreground:'#ff4',
fontColor:'#f5f5f5'
},
light:{
background:'#f5f5f5',
foreground:'#2060ff',
fontColor:'#333'
}
}
class Theme
{
constructor(background, foreground, fontColor)
{
this.background = background;
this.foreground = foreground;
this.fontColor = fontColor
}
}
let lightTheme = new Theme('#f5f5f5','#2060ff','#2060ff');
let lightTheme2 = new Theme('#f5f5f5','#2060ff','#2060ff');
let darkTheme = new Theme('#333','#ff4','#f5f5f5');
console.log(lightTheme)
console.log(darkTheme)
Theme.prototype.equals = function (other) {
console.log(this)
console.log(other)
return (
this.background === other.background &&
this.foreground === other.foreground &&
this.fontColor === other.fontColor);
}
console.log(lightTheme.equals(lightTheme2))