0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dartのアロー関数ってどうなってたんだっけ?

Posted at

Dart復習シリーズ。アロー関数、短くて良いのかもしれないが、なんか直感的にわかりづらいから、普通に書いてくれと思っちゃう。

bool isDone(String str) => str == 'done';

void main() {
  final done = isDone('done');
  print(done);// true
}

自分はカッコ()で処理内容を括ってくれた方が直感的に理解しやすいと思っちゃう人なのだけれど、まあ無駄っちゃ無駄。まあ慣れ次第よな。

bool isDone(String str) => (str == 'done');

void main() {
  final done = isDone('done');
  print(done);// true
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?