Guest User

Untitled

a guest
Jan 20th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // This FUNCTION DECLERATION...
  2. function double(num) {
  3. return num * 2
  4. }
  5.  
  6. // ...can be re-written as an ARROW FUNCTION....
  7. const double = (num) => {
  8. return num * 2
  9. }
  10. // ...and shortened by removing the parenthases,
  11. // since there's only one parameter, and by removing
  12. // the curly brackets and "return" since it implicitly
  13. // returns if there's only one line of code.
  14. const double = num => num * 2
Add Comment
Please, Sign In to add comment