Show First Then Maybe Explain 1

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 1

Instructor: [0:00] Today, we're going to be using the .someArray method to stop us from creating two users and our usersArray with the same email. Now, .some is really cool because what it does is it iterates over an array, but once the condition is met, it actually stops and returns us a Boolean. Unlike other array methods that actually continue to iterate over the length of the array.

[0:18] First, we're going to create the userExists variable. That's actually we're going to use for our .some method. We'll grab the user, and we'll check that userEmail against our new userEmail. If that user exists, we'll just throw a new error. The user with that email exists. Otherwise, we just create that new user.

[0:58] As you can see, we're already getting the error, because we're trying to create a user with two of the same email. If we were to change this to something like "Dan," everything would go just as planned, and we'll have both entries in our Users array. Pretty cool.

egghead
egghead
~ 30 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