第 26 / 105 道26 / 105 · #291
什么是一阶函数
What is a first order function
先自己答,再往下看Answer it yourself first
一句话:参数里没有函数、返回值也不是函数的普通函数。
(a, b) => a + b 是一阶的。arr.map(fn) 不是 —— 它收了个函数。
这个词单独考的时候很少,它存在的意义就是和「高阶」形成对照。 答题时一句话说完,然后主动接到高阶函数上, 显得你知道这三题是一组。
In one line: an ordinary function that takes no function as an argument and returns no function either.
(a, b) => a + b is first order. arr.map(fn) is not — it takes a function.
The term almost never gets asked on its own. It exists to give “higher order” something to contrast with. Answer it in one sentence, then move on to higher order functions yourself — that shows you know these three questions travel together.
这道题的出处:Comes from: 课程里的这一节 →this lesson →用抽认卡过一遍Run a flashcard round