4
\$\begingroup\$

Should submissions written in JS that return a promise be allowed?

For example:

Promise.resolve("hi")

Doesn't output "hi", but outputs a promise that resolves with the value of "hi". If you want "hi", then

Promise.resolve("hi").then(console.log)

is needed. Should the .then(console.log) part be required (and therefore part of the byte count)?

\$\endgroup\$
1
  • \$\begingroup\$ You might want to clarify what a promise is. \$\endgroup\$
    – Dennis
    May 10, 2017 at 17:26

1 Answer 1

6
\$\begingroup\$

No byte penalty

This is just an (abnormal) way of output that can show up often in fetch / submissions. I think this is absolutely fine.

\$\endgroup\$
1
  • \$\begingroup\$ In the future, please don't post answers for both sides. Let the people who actually support a side post an answer for it. Also, you don't need to make the answers community wiki. (you can, it's just not needed) \$\endgroup\$
    – Riker
    May 10, 2017 at 17:32