I encountered the code like below.
return new Promise(function (resolve, reject) {
if (!message) return reject(new Error('Requires message request to send'));
message = (0, _getURLJWT)(message);
.....
.....
var enc = (0, _encryptMessage)(plaintext, pubEncKey);
}, function (error, res, body) {
....
....
});
});
I do not understand the two expressions in the code:
message = (0, _getURLJWT)(message);
var enc = (0, _encryptMessage)(plaintext, pubEncKey);
This looks like IIFE(Immediately invoked function expression), however, I do not understand how the brackets at the end of the line exactly work or what they are doing.
Could anyone help me understand this?
_getURLJWT(message)
. Thanks for your comment. – Bagatelle