Diego Rios Diego Rios - 4 years ago 87
Node.js Question

Is 'err' a reserved word for an error?

I'm learning the MEAN stack and when I'm setting up my mongoDB with mongoose I use this:

mongoose.connect(mongooseUrl, function(err){
console.log('There\'s been an error');
} else {
console.log('Connected to '+ mongooseUrl + '!');

I just wanted to know if 'err' is a reserved keyword for error in JS.

Thank you!

Answer Source

No it is not... it is a completely arbitrary name that you assign yourself to a first function parameter in the arguments list

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download