Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Mark Zerr

Chapter 7 Pursue

Recommended Posts

I'm having difficulties with the first pursue activity in chapter 7. You're suppose to update today.js so neither argument can be an empty string and I'm not sure how to get started. I know how to check if a string is empty but I'm not sure how to prevent it from allowing the string to be empty. Any input would be greatly appreciated.

Share this post


Link to post
Share on other sites

Hello and welcome to the forums, Mark.

I'll start out by giving you a small hint, and if you still need a nudge, I'll give you a bigger hint.

 

For my small hint, you have to modify the following if statement so that it's even more restrictive than it is now:

 

 

   if ( (typeof elementId == 'string')
    && (typeof message == 'string') ) {

 

Does that help?

Share this post


Link to post
Share on other sites

HartleySan,

 

Thanks for the input so far. I'm still not exactly sure what I need to do to modify the if statement. I have a feeling it's something very simple that I'm overlooking. Another hint would be great.

Share this post


Link to post
Share on other sites

You need to add two more conditions to the if statement. Right now, you have the following two conditions:

- typeof elementId == 'string'

- typeof message == 'string'

 

You need to use && (the AND logical operator) to add two more conditions to the if statement to further restrict the acceptable values.

That help?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...