Skip to content

Instantly share code, notes, and snippets.

@msciotti
Created November 7, 2017 23:25
Show Gist options
  • Save msciotti/11b99a3d84e21b987111627ac5024c90 to your computer and use it in GitHub Desktop.
Save msciotti/11b99a3d84e21b987111627ac5024c90 to your computer and use it in GitHub Desktop.
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