Skip to content

Instantly share code, notes, and snippets.

@goodbedford
Last active April 2, 2016 03:13
Show Gist options
  • Save goodbedford/a0bac7d33a080b5fd07331dd4c8fd288 to your computer and use it in GitHub Desktop.
Save goodbedford/a0bac7d33a080b5fd07331dd4c8fd288 to your computer and use it in GitHub Desktop.
// to slice to copy part of an array
var rsvps = ["julie", "greg", "jess", "nicole", "kenn", "al", "angelina", "boo balm"];
// make a new list for the guys only after party
var guys = [];
guys.push( rsvps.slice(1,1).join("")); //greg
guys.push( rsvps.slice(3,1).join("")); //kenn
guys.push( rsvps.slice(3,1).join("")); //al
console.log("guys after-party", guys);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment