Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Arrow Function as an Expressio

let age = 5;

let welcome = (age < 18) ?
  () => console.log('Baby') :
  () => console.log('Adult');

welcome(); // Baby
Source by www.sitepoint.com #
 
PREVIOUS NEXT
Tagged: #javascript #Arrow #Function #Expressio
ADD COMMENT
Topic
Name
3+1 =