Skip to content

Instantly share code, notes, and snippets.

View waliurjs's full-sized avatar

Waliur Rahman waliurjs

View GitHub Profile
@waliurjs
waliurjs / objects-delegation-mutation.js
Created January 31, 2017 11:17 — forked from gor181/objects-delegation-mutation.js
Delegation, object mutation and how to avoid it. Javascript.
//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)
];

TodoMVC React