0

I am learning javascript, specifically react-js.

Here is a simplest example I am following to learn these technologies.

What I have learnt that usually we call a function like this

function_name (param1, param2) {
}

but I can't understand how multiple parenthesis after function name work. (atleast for a beginner like me).

I couldn't google anything as I don't know what do we call this kind of syntax in javascript.

import { Provider, connect } from 'react-redux';

class Counter extends Component {

const App = connect(mapStateToProps,mapDispatchToProps)(Counter)      

}                                                         ^(this)?

In the above example, How do they work?

Ramesh Pareek
  • 1,601
  • 3
  • 30
  • 55
  • Specifically, to _call_ a function we do it like this: `function_name(param1, param1);` and to declare a function we do it like this: `function_name(param1, param2) {}` – clabe45 Aug 05 '17 at 12:37
  • 1
    Re your question on the answer I just deleted: *"Ok, so does it mean that the function connect returns a function instead of a string/object."* Yes. – T.J. Crowder Aug 05 '17 at 13:17
  • A very humble question your majesty, :) may I know why you deleted the answer? – Ramesh Pareek Aug 05 '17 at 13:19

0 Answers0