0

Inside the OpenPGP.js module is this line of code:

return (0, _message.createVerificationObjects)
     (signatureList, [literalDataPacket], keys, date, true)

1.

createVerificationObjects is a function so I assume the following parenthetic are the values it requires. Why format this as

(function)(arguments)

instead of the traditional

(function(arguments))

2.

How can a return statement contain multiple values?

return (0, createVerificationObjects)

Shouldn't you be forced to choose between returning 0 or createVerificationObjects?

CuriousCat
  • 45
  • 1
  • 4
  • `(0, createVerificationObjects)` isn't multiple values it evaluates to `(createVerificationObjects)` the last value in the comma separated list. See this q&a: https://stackoverflow.com/questions/3561043/what-does-a-comma-do-in-javascript-expressions – Patrick Evans Nov 20 '19 at 22:29
  • "*How can a return statement contain multiple values?*" it's not multiple values, this is [a comma operator](https://stackoverflow.com/questions/3561043/what-does-a-comma-do-in-javascript-expressions) – VLAZ Nov 20 '19 at 22:29
  • @PatrickEvans That question explains how the comma operator works, but doesn't justify the way it's used here. See the duplicate that ASDFGerte pointed out. – Barmar Nov 20 '19 at 22:33
  • @Barmar I know i wasnt using it to justify its use. Just letting them know that `return (0,createVerificationObjects)` wasn't trying to return multiple things, their question 2 – Patrick Evans Nov 20 '19 at 22:37

0 Answers0