Advertisement
makispaiktis

Codecademy - 11th Course (Ways to declare a function)

Oct 2nd, 2019 (edited)
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ARROW FUNCTION
  2. const plantNeedsWater = (day) => {
  3.   if (day === 'Wednesday') {
  4.     return true;
  5.   }
  6.   else {
  7.     return false;
  8.   }
  9. };
  10.  
  11.  
  12. // CONCISE FUNCTION
  13. const plantNeedsWater = day => return day === "Wednesday" ? true : false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement