Skip to content

Complete Contact List Eval#30

Open
cjedrasik03 wants to merge 5 commits intoprojectshft:mainfrom
cjedrasik03:main
Open

Complete Contact List Eval#30
cjedrasik03 wants to merge 5 commits intoprojectshft:mainfrom
cjedrasik03:main

Conversation

@cjedrasik03
Copy link

No description provided.


const newContact = {
...formData,
id: Math.floor(Math.random() * 100000000)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract to a function for readability

};

// Handles submit button
const handleSubmit = e => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't be cheap with the param declaration

Suggested change
const handleSubmit = e => {
const handleSubmit = event => {


const allContacts = [defaultContact, ...savedContacts];

const found = allContacts.find(c => c.id.toString() === params.id);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware of readability

Suggested change
const found = allContacts.find(c => c.id.toString() === params.id);
const found = allContacts.find(contact => contact.id.toString() === params.id);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants