Diego Rios
Diego Rios

Reputation: 505

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){
if(err){
    console.log('There\'s been an error');
    console.log(err);
} else {
    console.log('Connected to '+ mongooseUrl + '!');
}

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

Thank you!

Upvotes: 0

Views: 582

Answers (1)

Dmitry Matveev
Dmitry Matveev

Reputation: 5376

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

Upvotes: 3

Related Questions