"Arrow" is the short-hand way of writing function. Before it, there was a much less-used operator in JS that would be handy way of writing "goes to" but that was not so popular as the arrow function.
  1. function countdown(n) {
  2. while (n --> 0) // "n goes to zero"
  3. alert(n);
  4. }
By running this script, the 'n' value is decremented till it becomes zero. It is short hand nortation of the below code.
  1. while( (n--)>0)
In the same way, the ==> function in JavaScript can be used to write the function.
  1. // ES5
  2. var selected = ArrayObj.filter(function (item) {
  3. return item.toUpperCase()
  4. });
  5. // ES6
  6. var selected = ArrayObj.filter(item=>item.toUpperCase());
The syntax for arrow function is
  1. (param1, param2, …, paramN) => expression
  2. // equivalent to: (param1, param2, …, paramN) => { return expression; }
  3. ()==>{return statement;} // with no parameter
This way of notation is very useful for writing functions in making filter,s maps, or performing any operation in array object along with doing small manipulations.
  1. // An empty arrow function returns undefined
  2. let empty = () => {};
  3. (() => 'foobar')();
  4. // Returns "foobar"
  5. var compareVar= a => a > 15 ? 15 : a;
  6. compareVar(16); // 15
  7. compareVar(10); // 10
  8. let max = (a, b) => a > b ? a : b;
  9. // Easy array filtering, mapping, ...
  10. var arr = [5, 6, 13, 0, 1, 18, 23];
  11. var sum = arr.reduce((a, b) => a + b);
  12. // 66
  13. var even = arr.filter(v => v % 2 == 0);
  14. // [6, 0, 18]
  15. var double = arr.map(v => v * 2);
  16. // [10, 12, 26, 0, 2, 36, 46]
Next time, for writting an inline function, the arrow operator can be used.