With the recent Flutter hype, Dart has gained quite a bit of attention. Dart was originally designed and implemented by Google to be used as a language that can be transpiled into JavaScript and vice versa. However, it didn’t pick up all too much on that front and TypeScript definitely became the industry standard — probably also due to the fact that it’s a superset of JavaScript and not a completely new language.

However, Dart is now on the rise again with Flutter. Here are three very cool language constructs you can use in Dart that are not possible in TypeScript or JavaScript.


Conditional Spread Operator

This is definitely my favorite and super elegant, although it is only available in Dart ≥2.90 at the time of writing. You use the conditional spread operator when you want to spread an iterable that could be undefined. It’s basically optional chaining for an iterable that you wish to spread.

#javascript #nodejs #programming #dart #flutter

3 Language Constructs From Dart That You Are Missing Out on in JS
1.20 GEEK