I am new to Function Programming.
Expectation: Have Multiple functions using compose. Pass two parameter in compose and in 1st function check two parameter are equal. 2nd function has two argument 1st function return and another argument
Scenario 1:
const _ = require("lodash-fp");
const checkParmeter = (arg1, arg2) => {
console.log(arg1);
console.log(arg2);
};
_.compose(checkParmeter("argument2"), _.isEqual)(1, 1);
Above code returning Expected a function
Scenario 2:
When i wrap checkParamter function in curry it works
const _ = require("lodash-fp");
const checkParmeter = _.curry((arg1, arg2) => {
console.log(arg1);
console.log(arg2);
});
_.compose(checkParmeter("argument2"), _.isEqual)(1, 1);
According to scenario 1 before 1st function returns 2nd function executed which caused error whether i am right?
Can anyone brief the code. how it behaves