我是这个平台的新手,也是新的编程人员。我正在学习回调,我有这个练习,我无法理解如何处理它

i'm new in the platform and also new programming. I'm learning callback and i have this excersice that i cannot undesrstand how to aproche it

您必须创建一个名为 callback 的函数,该函数接收一个 number 和一个 function[=22 作为参数=].此函数必须 return 该函数的结果作为参数给出参数 number

示例..

// - 回调(5, (num)=>{return num*10}) 应该 return 50 // - callback(25, (num)=>{return num/5}) 应该 return 5

谢谢!

这道题要求你创建一个函数,比如:

const todo = () => {}

使用函数的参数作为回调的参数执行回调,例如:

const todo = (a, b) => {
   // call method b using a as parameter
}

如果还是找不到答案,请给我留言,我会再帮你解答。