This file contains hidden or 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
//Some of the examples use spread syntax available via Babel in ES7 proposal. | |
//Live at: https://jsbin.com/zawavekepo/edit?js,console | |
//Arrays, slicing and avoiding mutations | |
const numArray = [10, 20, 30, 40, 50, 60]; | |
const removeAtIndex = (arr, x) => { | |
return [ | |
...arr.slice(0, x), | |
...arr.slice(x + 1) | |
]; |