I am looking at this code - https://facebook.github.io/react-native/docs/network.html
return fetch(\'https://facebook.github.io/react-native/movies.json\')
The basic syntax of fat arrow functions is:
(arg1, arg2, ...) => { ... }
However:
You can omit the () around the argument list if there's exactly one argument:
arg => { ... }
You can omit the {} around the function body if you only have a single expression in the body, in which case return is also implied:
arg => arg.foo
// means:
(arg) => { return arg.foo; }
Since callbacks of the form function (arg) { return arg.prop; } are extremely common in Javascript, these two special cases to the syntax make such common operations extremely concise and expressive. E.g.:
arr.filter(foo => foo.bar)