Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created July 21, 2019 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/65d3c9bea0b99ed2839f6e282eb0b919 to your computer and use it in GitHub Desktop.
Save codecademydev/65d3c9bea0b99ed2839f6e282eb0b919 to your computer and use it in GitHub Desktop.
Codecademy export
// Write your code here:
function justCoolStuff(array1, array2) {
let cool = [];
const checking = array1.filter(element => array2.includes(element));
cool.push(checking);
return cool;
};
// Feel free to uncomment the code below to test your function
const coolStuff = ['gameboys', 'skateboards', 'backwards hats', 'fruit-by-the-foot', 'pogs', 'my room', 'temporary tattoos'];
const myStuff = [ 'rules', 'fruit-by-the-foot', 'wedgies', 'sweaters', 'skateboards', 'family-night', 'my room', 'braces', 'the information superhighway'];
console.log(justCoolStuff(myStuff, coolStuff))
// Should print [ 'fruit-by-the-foot', 'skateboards', 'my room' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment