匿名函数lambda

Golang

// https://blog.csdn.net/yyclassmvp/article/details/124942527
sum := func(x int, y int) int {
   return x*y
}

Nodejs

const sum = (x, y) => x*y;

Python

sum = lambda x, b: x*b

C#

// https://blog.csdn.net/wojiuguowei/article/details/124492540
// 前2个参数类型,后1个返回值类型
Func< int, int, int> sum = (x, y) => x * y;
posted @ 2022-08-27 10:49  codeIsArt  阅读(9)  评论(0编辑  收藏  举报