Created
November 7, 2017 23:25
-
-
Save msciotti/11b99a3d84e21b987111627ac5024c90 to your computer and use it in GitHub Desktop.
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 links = []; | |
const rpLinks = [ | |
<div classname="header applicationsHeader"> | |
Rich Presence | |
</div> | |
]; | |
// First way | |
DocumentationPages.map(link => { | |
if (richPresenceDoc) { rpLinks.push(element); } | |
else links.push(element); | |
}); | |
links.push(rpLinks); | |
return links; | |
// Second Way | |
DocumentationPages.filter(doc => !doc.isRP).map(link => { links.push(elementFromLink) }); | |
Documentationpages.filter(doc => doc.isRP).map(link => { rpLinks.push(elementFromLink) }); | |
links.push(rpLinks); | |
return links; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment