arrow functions

Introduction
In this subunit, you'll learn how this symbol => will make your life a lot easier. This symbol is called a fat arrow (=>), and it is a shorthand way to write functions and craft simpler code. In the coming videos and resource we'll teach you exactly how to use fat arrows and arrow functions, some of the unexpected things they can do, and their shortcomings.
What are they
Arrow functions are shorthand for function expressions
They cannot be named, and they only work as function expressions.
They are ideal for shortening callbacks.
is the same as
Another Arrow Function
is the same as
More Arrow Functions
Arrow Functions have an implicit return if you leave out the curly braces
Gotcha with Arrow Function
You still need a return if it's not on one line!
You will sometimes see () around an arrow function - especially with modern frameworks!
If you want to return an object, make sure it's wrapped in () or on more than one line!
Arrow Functions and this
Arrow Functions do not have their own this context. If your function uses the keyword this, be wary!
You should not be using arrow functions:
In an object method
When you need your own keyword this
Arrow Functions & this - no no's
Do not use arrow functions inside of objects!
The keyword this refers to the global object (window/global) not the student object - that's not good!
Arrow Functions Usefulness
Use arrow functions when you don't want the keyword this that a function normally creates. Arrow functions are a replacement for the bind function in the example below.