Only constructor functions have prototypes. Since x
is a constructor function, x
has a prototype.
b
is not a constructor function. Hence, it does not have a prototype.
If you want to get a reference to the function that constructed b
(in this case, x
), you can use
b.constructor
More Related Contents:
- Prototypical inheritance – writing up [duplicate]
- What are the nuances of scope prototypal / prototypical inheritance in AngularJS?
- What is the reason to use the ‘new’ keyword at Derived.prototype = new Base
- Javascript object members that are prototyped as arrays become shared by all class instances
- Defining methods via prototype vs using this in the constructor – really a performance difference?
- Assigning prototype methods *inside* the constructor function – why not?
- Multiple inheritance/prototypes in JavaScript
- JS : Convert Array of Strings to Array of Objects
- ES6 arrow functions not working on the prototype?
- Asynchronous operations in constructor
- Extending an Object in Javascript
- Javascript when to use prototypes
- Create a reset of javascript Array prototype when Array.prototype has been modified?
- Grasping prototypical Inheritance through pseudoclassical instantiation (JavaScript)
- Can I construct a JavaScript object without using the new keyword?
- Understanding Crockford’s Object.create shim
- How to access object prototype in javascript?
- ‘this’ keyword, not clear
- Adding Prototype to JavaScript Object Literal
- Function.prototype is a function
- Javascript: hiding prototype methods in for loop?
- Can you create functions with custom prototypes in JavaScript?
- Advantages of setting the “constructor” Property in the “prototype”
- JavaScript Event prototype in IE8
- ‘this’ is undefined in JavaScript class methods
- JavaScript: What are .extend and .prototype used for?
- JS defineProperty and prototype
- [[Prototype]] vs prototype: ..what is the difference? (MyCons.__proto__ === MyCons.prototype) equals FALSE
- prototypal inheritance concept in javascript as a prototype based language
- ES6 – declare a prototype method on a class with an import statement