showing results for - "the constructor property returns the constructor function for all javascript variables "
Gianluca
14 Nov 2019
1
2"John".constructor                 
3// Returns function String()  { [native code] }
4
5(3.14).constructor                 
6// Returns function Number()  { [native code] }
7
8false.constructor                 
9// Returns function Boolean() { [native code] }
10
11[1,2,3,4].constructor             
12// Returns function Array()   { [native code] }
13
14{name:'John', age:34}.constructor 
15// Returns function Object()  { [native code] }
16
17	new Date().constructor            
18// Returns function Date()    { [native code] }
19
20function () {}.constructor        
21// Returns function Function(){ [native code] }
22