Which is more performant? I prefer the first one as it’s more pleasing to read vs the second one. Even if it’s a minuscule amount of performance gain which is better?
function(callback = () => {}) {
callback();
}
vs:
function(callback) {
if (typeof callback === 'function') {
callback()
}
}