function Ninja(){ this.swingSword = function(){ return true; }; }
Now the magazine is showing me the truth. which means swingSword, which were defined in Ninja.prototype, are overridden since I can override a function or constructor property. I know that preference is given to the constructor variable, why do I need to define a function or property inside the prototype?
javascript override constructor prototype
Mohammad faizan khan
source share