Message from JavaScript discussions

November 2020

β€” Brain teaser question for everyone


I'm guessing 2021, the extra (()) means that (2020, 2021) is evaluated before calling the function and by definition (a, b, ..., x) === x

β€” Awesome answerπŸ‘


β€” No output, return doesn't output anything. It would be "Twitter" if it did

β€” Why do u think it won't return anything? That's destructuring

β€” Your title needs to be a bit more specific ;)
return doesn't output anything to the console.
If at all, return "returns" a value. The function has an "outcome/result".

Message permanent page

β€” I usually use readline for simple things:

const { createInterface } = require('readline');
const rl = createInterface(process.stdin);
for await (const line of rl) {
// do stuff with line
rl.close(); // stop accepting lines

Message permanent page

β€” Readline-sync if you're into sync stuff

β€” Yucky

β€” Ik, but I sometimes had to resort to it as native readline exposes a much more difficult interface

β€” Someone needs to make an async equivalent of rls