so I was learning about callback functions, and I was wondering why you can't use parameters in the callback. I explain myself with this code:
function one (name) {
console.log(`Hey ${name}`);
}
function two (fn){
console.log('Let me salute you:');
fn();
}
two(one);
If I try to put two(one('Chris'))
, won't work, It will give you an error and call the one
function first. So, how it should be done?
thanks in advance!