Hello I have some problem understanding the following code related to node.js.
var config = {
local: {
mode: 'local',
port: 3000
},
staging: {
mode: 'staging',
port: 4000
},
production: {
mode: 'production',
port: 5000
}
}
module.exports = function(mode) {
return config[mode || process.argv[2] || 'local'] || config.local;
}
I cannot understand
return config[mode || process.argv[2] || 'local'] || config.local;
this part. What and how will the OR operator work and return.