Do lambda expressions have any use other than saving lines of code?

后端 未结 9 1542
我寻月下人不归
我寻月下人不归 2020-11-29 18:23

Do lambda expressions have any use other than saving lines of code?

Are there any special features provided by lambdas which solved problems which weren\'t easy to s

9条回答
  •  佛祖请我去吃肉
    2020-11-29 18:41

    One thing I don't see mentioned yet is that a lambda lets you define functionality where it's used.

    So if you have some simple selection function you don't need to put it in a separate place with a bunch of boilerplate, you just write a lambda that's concise and locally relevant.

提交回复
热议问题