I am trying to log this in the console of Chromium browser
function.prototype.newMethod = function(name,f){
this.prototype[name] = f;
return this;
}
and I get "SyntaxError: Unexpected token ."
I don't see the issue. Can someone please help me resolve this.
Thanks!
function.prototypedoesn't make any sense.functionis a reserved keyword, not a type. Do you meanFunction.prototype?