Test name | Executions per second |
---|---|
instance method | 96347256.0 Ops/sec |
callback | 111812848.0 Ops/sec |
const _onSuccess = () => {
return {
a: "something",
b: "something else"
}
}
const upload = (successCb) => {
return successCb()
}
const onClick = () => {
return upload(_onSuccess)
}
const onClickCb = () => {
const onSuccess = () => {
return {
a: "something",
b: "something else"
}
}
return upload(onSuccess)
}
window.onClick = onClick
window.onClickCb = onClickCb
onClick()
onClickCb()