Created
November 20, 2017 04:44
-
-
Save rsyring/fbb54bb2f4b5bdf6cce892ee6a8fae32 to your computer and use it in GitHub Desktop.
Revisions
-
rsyring created this gist
Nov 20, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ function Contacts(vn) { let contacts = [ {name: 'Fred', email: '[email protected]'}, {name: 'Bob', email: '[email protected]'}, ] function addContact(contact) { contacts.push(contact) } function delContact(email) { // PROBLEM HERE contacts = contacts.filter((el) => el.email !== email); } return { view: function() { return m("main", [ m(ContactForm, {addContact: addContact}), m(ContactList, {contacts: contacts, delContact: delContact}), ]) } } }