Show First Then Maybe Explain 3

Lauro Silva
InstructorLauro Silva
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

To help make you become more comfortable with the idea of recording your very first lesson, we’ve compiled a few Lesson Feedback Cycles, taking an instructor from their first take to their final lesson, showing you where each instructor began with their lesson, and how they took in feedback from their coaches to create that final product we are proud to publish on egghead.io!

Take away from this feedback cycle: Show First Then Maybe Explain 3

Instructor: [0:00] First in the addUser() function, we'll create a variable called userExists. That will hold our .sum function, so users.sum, we'll grab the user and we'll compare the user's email to our new user's email.

[0:16] From there, we can just do an IF block. If the user exists, we're just going to throw a new error, "That email already exists." Otherwise, we can just create the user using that new user.

[0:38] As you can see, we're getting an error. What's happening is the addUser function is taking in this new user. It's then comparing that user's email to all of the users that are inside of the users array. It's finding that it does match, so we're going to throw this error.

[0:56] If we were to change this to another name inside of the email -- let's try again -- you can see now both objects were pushed in. Now, we have two users inside the array. Awesome.

egghead
egghead
~ 2 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today