Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This FUNCTION DECLERATION...
- function double(num) {
- return num * 2
- }
- // ...can be re-written as an ARROW FUNCTION....
- const double = (num) => {
- return num * 2
- }
- // ...and shortened by removing the parenthases,
- // since there's only one parameter, and by removing
- // the curly brackets and "return" since it implicitly
- // returns if there's only one line of code.
- const double = num => num * 2
Add Comment
Please, Sign In to add comment