Point the constructor to itself, otherwise it will point to Object by default
var Plugin = function(){}
Plugin.prototype = {
sayHello:function(){
console.log("hello")
}
}
var p = new Plugin()
console.log(p.constructor === Object) //true
If you add constructor
var Plugin = function(){}
Plugin.prototype = {
constructor: Plugin,
sayHello:function(){
console.log("hello")
}
}
var p = new Plugin()
console.log(p.constructor === Plugin) //true
Point the constructor to itself, otherwise it will point to Object by default
If you add constructor