Hi, guys
Sorry for my bad english…
Yesterday i was started learning a JQuery at codeacademy. I have some experience with Javascript and JQeury and i thought that iam not a beginner until i was found this exercise.. I realy cant figure out in past 30 minutes what is the correct answer. Please guys youre much more smarter then me and i need your help. Can somebody explaine me step by step what that function doing :) ?
//this function adds 3 to the number passed in
function addThree(x) {
return x + 3;
}
//this function takes a function and returns
//a function that runs the function it was passed,
//and then runs that function _again_ on the return
//value of the first call to the function.
//make sense? look at it until it does.
function composed(func) {
return function(x) {
return func(func(x))
}
}
composed(addThree)(4);
//what does that return?
var answer = ;