It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
###And so far for the attempt of your to create a callback function. You are only missing a return statement in the function see the result.
And so far for the attempt of your to create a callback function. You are only missing a return statement in the function see the result.
var callback = function (num) {
return function(){
return num + 1;
};
}
var fn = function (callback) {
return callback();
}
console.log(fn(callback(5)));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
###And so far for the attempt of your to create a callback function. You are only missing a return statement in the function see the result.
var callback = function (num) {
return function(){
return num + 1;
};
}
var fn = function (callback) {
return callback();
}
console.log(fn(callback(5)));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
And so far for the attempt of your to create a callback function. You are only missing a return statement in the function see the result.
var callback = function (num) {
return function(){
return num + 1;
};
}
var fn = function (callback) {
return callback();
}
console.log(fn(callback(5)));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
###And so far for the attempt of your to create a callback function. You are only missing a return statement in the function see the result.
var callback = function (num) {
return function(){
return num + 1;
};
}
var fn = function (callback) {
return callback();
}
console.log(fn(callback(5)));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
###And so far for the attempt of your to create a callback function. You are only missing a return statement in the function see the result.
var callback = function (num) {
return function(){
return num + 1;
};
}
var fn = function (callback) {
return callback();
}
console.log(fn(callback(5)));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
It is happening due the parameter naming. Use the following
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));
It is happening due the parameter naming. The way you are using the parameters, makes a call to function called 6() which ends up being incorrect.
So, Use the following (IMO, this is what you are attempting)
var callback = function (num) {
return num + 1;
}
var fn = function (num) {
callback(num);
}
fn(callback(5));