forked from dynamoose/dynamoose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
69 lines (48 loc) · 2.51 KB
/
test.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
69
var regexFuncName = /^Function ([^(]+)\(/i;
console.log('typeof Object: ' + typeof Object);
console.log('Object.constructor.name: ' + Object.constructor.name);
console.log('Object function name: "' + Object.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof String: ' + typeof String);
console.log('String.constructor.name: ' + String.constructor.name);
console.log('String function name: "' + String.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof [String]: ' + typeof [String]);
console.log('[String].constructor.name: ' + [String].constructor.name);
console.log('[String] function name: "' + [String].toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof Date: ' + typeof Date);
console.log('Date.constructor.name: ' + Date.constructor.name);
console.log('Date function name: "' + Date.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof Number: ' + typeof Number);
console.log('Number.constructor.name: ' + Number.constructor.name);
console.log('Number function name: "' + Number.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof Boolean: ' + typeof Boolean);
console.log('Boolean.constructor.name: ' + Boolean.constructor.name);
console.log('Boolean function name: "' + Boolean.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof Array: ' + typeof Array);
console.log('Array.constructor.name: ' + Array.constructor.name);
console.log('Array function name: "' + Array.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof Buffer: ' + typeof Buffer);
console.log('Buffer.constructor.name: ' + Buffer.constructor.name);
console.log('Buffer function name: "' + Buffer.toString().match(regexFuncName)[1] + '"');
console.log('\n');
console.log('typeof {}: ' + typeof {});
console.log('{}.constructor.name: ' + {}.constructor.name);
console.log('{}.toString(): ' + {}.toString());
console.log('\n');
console.log('typeof []: ' + typeof []);
console.log('[].constructor.name: ' + [].constructor.name);
console.log('[].toString(): ' + [].toString());
console.log('\n');
console.log('typeof \'\': ' + typeof '');
console.log('\'\'.constructor.name: ' + ''.constructor.name);
console.log('\'\'.toString(): ' + ''.toString());
console.log('\n');
console.log('typeof /regex/: ' + typeof /regex/);
console.log('/regex/.constructor.name: ' + /regex/.constructor.name);
console.log('\n');console.log('/regex/.toString(): ' + /regex/.toString());