2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ラムダ式の使い分けだっちゃ

Last updated at Posted at 2016-10-05

初心者向けメモ化

何も渡さない
a = () => 0

渡す
a = (x) => x + 1; // カッコは省略化

指定して渡す。
a = (int x) => x + 1;

複数引数
a = (int x ,int y) => x + y;

戻り値あり
a = x => {return x * 5;}

追記
{}をつけることで複数行処理がかける。

追記
戻り値あり(NetSeedさんよりご指摘)
Func a=x=>x*5;

2
2
7

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?