Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hetav Desai | FrontEnd Project 1 Submission #1

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

desaihetav
Copy link

No description provided.

app.js Outdated

function initializeNotes() {
var notesArr = localStorage.getItem(["notes"]);
if (JSON.parse(notesArr) == null || JSON.parse(notesArr).length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

instead of parsing twice, you can parse once and store it in a variable. Also, on first start notesArr would be undefined, and hence JSON.parse will fail with error, won't it?

Copy link
Author

Choose a reason for hiding this comment

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

Yup, using variable would be better.

And localStorage.getItem() returns null if the data we want isn't store in local storage. And hence, on first start, notesArr will be null and JSON.parse() will return null as well.

}

.div-edit {
outline: none;
Copy link
Member

Choose a reason for hiding this comment

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

@chinchang
Copy link
Member

chinchang commented Dec 18, 2020

Hey @desaihetav Great work on this app! I liked it! 👏
I have left a few comments that can make your code more readable, robust and accessible to people. Feel free to ask me by replying if any comment is not clear or needs discussion.

Loved using the actual app! ❤️

@chinchang
Copy link
Member

I noticed one commit was messaged "add empty state" n other "added icon buttons".

  1. there was inconsistency - "add" vs "added".
  2. commit messages should be written in present tence - "add". https://chris.beams.io/posts/git-commit/#imperative

@chinchang
Copy link
Member

@desaihetav If this code review did help you even a bit become a better developer, I would request you to please retweet/quote this tweet -> https://twitter.com/chinchang457/status/1332706876329365512?s=20

probably asking more people to submit here :) That's all we want...helping more people become better devs :)

@desaihetav
Copy link
Author

Hey @desaihetav Great work on this app! I liked it! 👏
I have left a few comments that can make your code more readable, robust and accessible to people. Feel free to ask me by replying if any comment is not clear or needs discussion.

Loved using the actual app! ❤️

Thank you very much @chinchang for the code review. It was a first time experience getting my code reviewed. Each of your comments is indeed very insightful.

Really appreciate the efforts you're putting in!😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants