简体   繁体   English

“ err”是错误的保留字吗?

[英]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: 我正在学习MEAN堆栈,并在用mongoose设置mongoDB时使用了以下方法:

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. 我只是想知道'err'是否是JS错误的保留关键字。

Thank you! 谢谢!

不,不是。。。它是一个完全任意的名称,您将自己分配给了参数列表中的第一个函数参数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM