Are there differences between .then(functionReference) and .then(function(value){return functionReference(value)})?

前端 未结 4 1418
深忆病人
深忆病人 2020-12-01 18:35

Given a named function utilized to handle a Promise value

function handlePromise(data) {
  // do stuff with `data`
  return data
}
4条回答
  •  臣服心动
    2020-12-01 19:13

    There is no difference, function(x){return f(x)} === f.

    For more info, you may want to read about eta-conversion in lambda calculus.

提交回复
热议问题