回答編集履歴
1
追記
test
CHANGED
@@ -10,3 +10,16 @@
|
|
10
10
|
console.log(a instanceof xx);
|
11
11
|
console.log(a.type);
|
12
12
|
```
|
13
|
+
なお、昔はarguments.calleeを参照することがありましたが今は非推奨です
|
14
|
+
```javascript
|
15
|
+
function oo(){
|
16
|
+
this.type=arguments.callee.name;
|
17
|
+
};
|
18
|
+
function xx(){
|
19
|
+
this.type=arguments.callee.name;
|
20
|
+
};
|
21
|
+
const a=new oo;
|
22
|
+
console.log(a instanceof oo);
|
23
|
+
console.log(a instanceof xx);
|
24
|
+
console.log(a.type);
|
25
|
+
```
|