Did you know?
One of the four snippets below is invalid (won't compile).
Can you guess which one and why?
According to the language specification, you can’t begin a switch expression at the beginning of a line.
To solve this:
- assign the expression to a variable (option 2)
- wrap the expression with parenthesis (option 3)
- return the expression (option 4)
Found this useful? Show some love and share the original tweet 🙏
Previous | Next |
---|---|
6 steps to minimize your Firebase Bill | Measuring execution time in Dart |