Function call in JavaScript with another parentheses "func()();"

时间:2018-02-03 07:47:11

标签: javascript react-native

I am new to JavaScript but I started a course for building react native applications, my problem was understanding this expression in redux export default connect(mapStateToProps)(ComponentName);

I'm just having trouble understanding this expression functionName(params)(classname). What does this expression exactly means as of syntax (I'm not trying to understand the redux side of this) and how to use it?

1 个答案:

答案 0 :(得分:2)

Seem like functionName(params) returns a closure or another function which gets called directly, passing it the classname variable.