Write nodejs, now write function with arrow function completely instead of function?

  node.js, question

Or when will the function be retained? Can we discuss the question of Programming style?

Arrowhead function is a small function with only a few words in its abbreviated part.

Pay attention to its side effects when using it:

  1. In function bodythisAn object is an object that is defined, not used.

  2. It cannot be used as a constructor, that is, it cannot be usednewCommand, otherwise an error will be thrown.

  3. Not availableargumentsObject that does not exist in the function body. If you want to use it, you can use it.RestParameter substitution.

  4. Not availableyieldCommand, therefore arrow functions cannot be used asGeneratorFunction.

Especially the first point, we must pay attention to using arrow function in array iteration function.thisThe change of.