JavaScript Unknown Meaning of ES6 Syntax

Currently I am working on Learning React and Redux. I have found a boilerplate, and I am working on looking through all of the example code. My problem is I don't completely understand what a lot of this ES6 syntax means.

What I have learned so far is that hello = () => "Hello"; would be equivalent to:

hello = function hello() {
  return "Hello";
};

Then changing the above to hello = name => "Hello " + name; would convert it to:

hello = function hello(name) {
  return "Hello " + name;
};

That all makes perfect sense, basically it is just shortening it down so you don't have to write the function and its return statement. Yet, I have come across some syntax that I cannot rap my head around. It is as follows:

const mapActionCreators = {
  increment: () => increment(1),
  doubleAsync
}

The above code is converted to:

var mapActionCreators = {
  increment: function (_increment) {
    function increment() {
      return _increment.apply(this, arguments);
    }

    increment.toString = function () {
      return _increment.toString();
    };

    return increment;
  }(function () {
    return increment(1);
  }),
  doubleAsync: doubleAsync
};

I understand that () => increment(1) in this case is being turned in to:

(function () {
    return increment(1);
}),

Overall I guess my question is, how does increment: get converted in to:

 increment: function (_increment) {
    function increment() {
      return _increment.apply(this, arguments);
    }

    increment.toString = function () {
      return _increment.toString();
    };

    return increment;
 }

What is the meaning of the code?

Answer:1

I have my custom script for map into my webpage,but it no have point mark for exactly ubication: <script> /* Map */ (function () { "use strict"; if (document.getElementById("map")) { ...

I have my custom script for map into my webpage,but it no have point mark for exactly ubication: <script> /* Map */ (function () { "use strict"; if (document.getElementById("map")) { ...

  1. mark point google maps

I have a link with an hover effect. When you hover it, the text become red and underlined. When you click it, the text stay red and underlined. My problem is that once you clicked on the link, the ...

I have a link with an hover effect. When you hover it, the text become red and underlined. When you click it, the text stay red and underlined. My problem is that once you clicked on the link, the ...

  1. hover click event jquery
  2. mouse hover click jquery
  3. hover after click jquery
  4. hover instead of click jquery
  5. remove hover on click jquery
  6. change hover to click jquery
  7. combine hover and click jquery
  8. jquery hover click conflict
  9. jquery hover click mobile
  10. hover and click function jquery
  11. convert hover to click jquery
  12. jquery hover click toggle
  13. disable hover after click jquery

I'm trying to retrieve a single result from a multi-dimensional array and then push that result into each object contained within an object array. Here is my code; var data = { "questions": ["...

I'm trying to retrieve a single result from a multi-dimensional array and then push that result into each object contained within an object array. Here is my code; var data = { "questions": ["...

  1. push property into object javascript
  2. push property into object
  3. push new property into object javascript
  4. javascript push property into array
  5. javascript push object property into array

I created a chart using the dimple.js library with the following code: var myChart = new dimple.chart(svg, data); var x = myChart.addMeasureAxis("x", "x-measure"); x.tickFormat = "%"; var y = myChart....

I created a chart using the dimple.js library with the following code: var myChart = new dimple.chart(svg, data); var x = myChart.addMeasureAxis("x", "x-measure"); x.tickFormat = "%"; var y = myChart....