Skip to content

Instantly share code, notes, and snippets.

@proclaim
Last active May 25, 2016 14:30
Show Gist options
  • Save proclaim/79607b87b327d526eb3d181a61fe8e2f to your computer and use it in GitHub Desktop.
Save proclaim/79607b87b327d526eb3d181a61fe8e2f to your computer and use it in GitHub Desktop.
Remove item from array with mutation
const students = ['yoshie', 'hiroshie', 'lisa', 'johnny'];
students.splice(0,1);
console.log(students);
// ["hiroshie", "lisa", "johnny"]
// mutation, 不行啊~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment