Advertisement
karlakmkj

Function expressions - concise body arrow function

Dec 9th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Original concise body using ternary operator
  2. const plantNeedsWater = (day) => {
  3.   return day === 'Wednesday' ? true : false;
  4. };
  5.  
  6. //rewrite it to concise body arrow function in one line
  7. //remove the parentheses, curly braces, and the return keyword
  8. const plantNeedsWater = day => day === 'Wednesday' ? true : false;
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement