Message from JavaScript discussions

May 2017

— Javascript finally making an effort to not be named after something else.


I write JS like this, should I use Lisp?

const promisify = f =>
(...args) =>
new Promise((resolve, reject) =>
f(...args, (err, ...results) =>
? reject(err)
: (results.length > 1
? resolve(results)
: resolve(results[0]))));

— Haha, very nice

— Good that you indent ternaries, I like that

— That's the way Crockford recommends to indent them

— Hah

— Not to say that i linted this snippet

— I don't even lint my js tbh

— I mean I may have a lint whenI run make for certain projects but I never lint during dev

— "The ternary operator can be visually confusing, so ? question mark and : colon always begin a line and increase the indentation by 4 spaces."

return ( === "(string)" || === "(number)")
? String(the_token.value)

Message permanent page

— Having your editor autolint while typing can be great for beginners

— It feels annoying for me now though