Avoid instanceof for native object types
For classes defined in the module, this is fine. For 'Error' it's probably not very hazardous. However, testing 'Object' and 'String' is much more reliable using typeof, to work with the repl and NODE_MODULE_CONTEXT modes.
parent
e142fe2b
Please register or sign in to comment