Skip to content

Instantly share code, notes, and snippets.

@viniciusdacal
Created December 1, 2017 17:36
Show Gist options
  • Save viniciusdacal/ecf05f4c2b85913e6d3c106955cdc81b to your computer and use it in GitHub Desktop.
Save viniciusdacal/ecf05f4c2b85913e6d3c106955cdc81b to your computer and use it in GitHub Desktop.
const channelLabel = (channelKey) => {
switch(channelKey) {
case 'tv':
return 'TV/OTT';
case 'youtube':
return 'Youtube';
case 'instagram':
return 'Instagram';
default:
return 'Default value'
}
}
const channelLabel = (channelKey) => {
const channels = {
tv: 'TV/OTT',
youtube: 'Youtube',
instagram: 'Instagram',
};
return channels[channelKey] || 'Default value';
}
@renatobenks-zz
Copy link

💯 right approach!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment