forked from liviuschera/noctis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JavaScript.js
32 lines (26 loc) · 845 Bytes
/
JavaScript.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
/**
* Creates an instance of a Person.
* @param {string} who - The name of the person.
*/
const BROWSER = navigator.userAgent.search("Firefox") > -1;
export default class Person {
constructor(who, likesDogs) {
this.who = who;
this.likesDogs = likesDogs;
}
about() {
const { who, likesDogs } = this;
let select = 12345;
if (likesDogs) {
select = "dogs";
} else {
select = "cats";
}
return `${who} likes ${select}`;
}
}
var John = new Person("John", true);
class Someone extends Person {}
console.log(John.about().length, BROWSER);
console.log(Someone);
let a = () => {};