Last active
June 29, 2021 05:40
-
-
Save narennaik/613db47700d005d26899a5a888c212e2 to your computer and use it in GitHub Desktop.
using .map multiple times
This file contains 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 getDomainName = (item) => item.details.name; | |
const getProtocol = (item) => (item.details.valid ? 'https' : 'http'); | |
const getUrl = (item) => `${getProtocol(item)}://${getDomainName(item)}`; | |
// TODO: (temporary) Adding callback=true because server side redirection needs this parameter | |
const addCallbackParameter = (url) => `${url}?callback=true`; | |
const urlList = domainList.map(getUrl).map(addCallbackParameter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment