Answers for "The constructor property returns the constructor function for all JavaScript variables."

0

The constructor property returns the constructor function for all JavaScript variables.

"John".constructor                 
// Returns function String()  { [native code] }

(3.14).constructor                 
// Returns function Number()  { [native code] }

false.constructor                 
// Returns function Boolean() { [native code] }

[1,2,3,4].constructor             
// Returns function Array()   { [native code] }

{name:'John', age:34}.constructor 
// Returns function Object()  { [native code] }

	new Date().constructor            
// Returns function Date()    { [native code] }

function () {}.constructor        
// Returns function Function(){ [native code] }
Posted by: Guest on June-30-2021

Code answers related to "The constructor property returns the constructor function for all JavaScript variables."

Code answers related to "Javascript"

Browse Popular Code Answers by Language