📅  最后修改于: 2022-03-11 15:03:56.058000             🧑  作者: Mango
const add = (a, b, callback) => {
setTimeout(() => {
callback(a + b)
}, 2000)
}
add(2, 3, (sum) => {
console.log(sum) // should output 5 after 2 seconds
})