brunch

You can make anything
by writing

C.S.Lewis

by 유윤식 Jan 27. 2021

Anonymous 함수

#익명함수, #파이썬, #타입스크립트

파이썬 익명함수


def plus(a, b):

    return a+b

print(plus(1, 2))

==> 3


plus = lambda a, b: a+b

print(plus(1, 2))

==> 3


타입스크립트 익명함수


function plus(a, b) {

    return a+b

}

console.log(plus(1, 2))

==> 3


let plus = (a, b) => {

    return a+b

}

console.log(plus(1, 2))

==> 3


그냥 써보고 싶어서 끄적여봤음...

작가의 이전글 Python API: FastAPI(3)
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari