Short Circuiting


function getIconPath(icon) { 
   const path = icon.path ? Icon.path : 'C:\temp\file.png';
   return 'prefix' + path;
}

function getIconPath(icon) { 
   const path = icon.path || 'C:\temp\file.png';
   return 'prefix' + path;
}


© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext