Created
December 1, 2017 17:36
-
-
Save viniciusdacal/ecf05f4c2b85913e6d3c106955cdc81b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
💯 right approach!