Read a JSON array of integers. Wrap each in Promise.resolve, await them all with Promise.all, and print the sum of the resolved values.
Input: one JSON array. Output: the sum.
Your program reads from stdin and prints to stdout.
Example 1
Input: [1,2,3]
Output: 6
Hints
Read a JSON array of integers. Wrap each in Promise.resolve, await them all with Promise.all, and print the sum of the resolved values.
Input: one JSON array. Output: the sum.
Your program reads from stdin and prints to stdout.
Example 1
Input: [1,2,3]
Output: 6
Hints