September 2017
— Yeah
But that's kind of bad practice in languages with duck-typing, since it means you can't easily subclass/add behaviour
— Or instanceof or isPrototypeOf
— Complex duck typing can also validate functions, I think
— But that's more unit-testy and less production
— Well, instanceof would still work in JS:
class MyError extends SyntaxError { ...}new TypeError() instanceof Error // truenew MyError() instanceof Error // true
Message permanent page
— I rarely use classes
— I'm getting buffer.alloc is not a function error when I try to install using npm
— What to do
— Lmao
— Update node and / or npm?
— I resolved it