Is this another overly hyped article about JavaScript. Perhaps!!! Maybe after reading this you will share my enthusiasm 😁. In 2020 JavaScript will...
For further actions, you may consider blocking this person and/or reporting abuse
Optional Chaining is my favorite though.
Not to mention nullish coalescing. 😍
So here's an opinion: none of these are at all interesting as 'features'. They don't really extend the language - at best they're sugar over what's there already. The benefits are minor.
The downsides are not insignificant. Extending the language syntax like this means you have to 'know' a lot more magic symbols and incantations in order to 'know' JavaScript. Every extension like this makes it a harder language to learn with, to my view, very little benefit. "Scheme for the browser" has never looked so complicated.
Nice article though.
If that opinion stands on "lot more magic symbols and incantations in order to 'know' JavaScript" - what does this 'know' means?
Does mastering of JS mean knowing all the features? - I do not think so, there is documentation anyway.
Does mastering of JS mean using all the features? - same answer I guess, no one is using all what is available out there.
"magic symbols and incantations" and "The downsides are not insignificant."? - No, but nice hyperbole. There is documentation, and i cannot think about realistic scenario in which someone knows how to use String.prototype.match() and is unable to get how String.prototype.matchAll() works, or same with Object.entries() and Object.fromEntries() - I think this is just filling holes in something what i would call language 'symmetry' in this case (maybe not so needed, but better to have than to not have :-)).
Anyway are problems in understanding really coming from number of features or more from the usage itself? How long is RegExp there? I am weak in RegExp (my fault), but sometimes i am using it and it is handy, BUT i've seen few professional devs 10+ years in a job staring long minutes into some weird RegExp not knowing how exactly(!) it works...
I agree this is nothing big like ES6. And I also kind of agree than less is more, but not always.
Most of it (all?) is already ready to use in chrome or Babel, optional chaining will be usable, waiting for it coming into chrome, Object.fromEntries() is usable, same with BigInt and Promise.allSettled - i am not even using any framework so cannot comment module import and i am not professional dev anyway, I just do not think things are black or white.
I'd say to 'know' javascript implies, at the very least, being handed any snippet of JS code (that's not written specifically to be unreadable) and being able to figure out what it does on a language-level without having to consult the documentation.
This is specially relevant in cases like the
?.
operator, which is hard to google when encountered in the wild.Agree. Let's just stick to C++, or better even, assembly language. Much less to learn!
I do agree this list didn't bring much to the table, though... (except the dynamic runtime imports perhaps?) They're might be more interesting things coming up. Were private fields mentioned here?
Nope I didn't mention that. Think that is still in stage 2..might be mistaken
TypeScript 3.7 already has an Optional Chaining:
Switch to TS, guys, and you won't have to wait 2020, lol.
😆😆😆 looool
Optional chaining! 🎉
Hell yeah!!!
The biggest question is browsers support for those amazing features
If you use a transpiler (eg, Babel/Typescript), they'll all be available
Optional Chaining is definitely my pick of the bunch here. The amount of time and hassle this will save is fantastic!
Thanks for sharing the good news!
Funny how those are all things that Ruby has had for ages now (except the promise-related one, which is obviously a javascript-specific feature).
Ohh man I love ruby. Reminds me of good ol days.
Nice piece with succinct examples, great work!
Thanks for this post! Very useful information!
They all mean nothing to me because I'm such a noob I have no idea how to use such things and what they are good for.
feelsbadman
Everyone has to start somewhere. You will get there eventually. Not too long ago we all were noobs :)
Agreed. I'm a noob with 15 years experience
Fake it till you make it brah
Thank you Shadid!
Hello Optional Chaining!
I was hoping that Temporal would be part of ECMAScript 2020. Sadly, it appears to be only in stage 2 at the moment. github.com/tc39/proposal-temporal