News for hackers. Stuff that matters.
Re:A Modern JavaScript Tutorial by throw_m239339 on Monday December 07, 2020 @12:38PM (#25334526)
> The default way promises are used is now async/await. `.then()` should not be introduced as anything more than 'you may find this in older codebases'.

No, because you might have to write explicit promises in the browser with async API that are callback based.

You need to understand how promises work to use async/await at first place anyway.

Just like it's better to understand how prototypal inheritance works in JS BEFORE even using a single class declaration.

Re:A Modern JavaScript Tutorial by hutzlibu on Monday December 07, 2020 @01:01PM (#25334876)
"Just like it's better to understand how prototypal inheritance works in JS BEFORE even using a single class declaration. "

About that, does JS class inheritance now work like classes in java for example? Or is it still just syntactic sugar for the prototype inheritance? By your wording, I assume the later?

Re:A Modern JavaScript Tutorial by ragnese on Monday December 07, 2020 @01:55PM (#25335669)
Correct. It's still prototype based. Thus making the class keyword actually MORE confusing for people from other languages, IMO.
Re:A Modern JavaScript Tutorial by wa1987 on Monday December 07, 2020 @01:34PM (#25335375)
Re:A Modern JavaScript Tutorial by hutzlibu on Monday December 07, 2020 @01:50PM (#25335591)
Wow. I was hoping, at some point things would improve a bit.
Re:A Modern JavaScript Tutorial by wa1987 on Monday December 07, 2020 @01:57PM (#25335692)
Agreed. I find myself using a pretty small subset of the language which definitely doesn't include the class keyword. Doubt I'll ever find it useful.
Re:A Modern JavaScript Tutorial by hutzlibu on Monday December 07, 2020 @02:25PM (#25336035)
Yeah, like many people, I ended up making my own inheritance routines. Then when class came out, I was half rejoicing, half regretting to put up the work. But well, no thanks. I rather keep using my own far from perfect way of things.
Re:A Modern JavaScript Tutorial by nailer on Monday December 07, 2020 @11:58PM (#25342039)
Yes because you can and should promisify old libraries.
Re:A Modern JavaScript Tutorial by throw_m239339 on Tuesday December 08, 2020 @02:01AM (#25342679)
No because some async Web API are just a bit more complex than just 'promisify' this or that.
Re:A Modern JavaScript Tutorial by nailer on Tuesday December 08, 2020 @06:18AM (#25343930)
Which ones?