{ // returns a function with argument of args
return fn(args) //call the callback function and pass the args inside
}
}
const toUpperCase = foo((string) => string.toUpperCase()); //call foo() and puts a callback function inside of it;
console.log(toUpperCase("hello")); /// args value from the foo return am i uderstanding this right ?
yep
Обсуждают сегодня