Mark Zerr Posted March 21, 2013 Share Posted March 21, 2013 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. Link to comment Share on other sites More sharing options...
HartleySan Posted March 21, 2013 Share Posted March 21, 2013 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? Link to comment Share on other sites More sharing options...
Mark Zerr Posted March 21, 2013 Author Share Posted March 21, 2013 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. Link to comment Share on other sites More sharing options...
HartleySan Posted March 21, 2013 Share Posted March 21, 2013 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? Link to comment Share on other sites More sharing options...
Mark Zerr Posted March 21, 2013 Author Share Posted March 21, 2013 Got it. Thanks! Link to comment Share on other sites More sharing options...
HartleySan Posted March 22, 2013 Share Posted March 22, 2013 Good job. Link to comment Share on other sites More sharing options...
Recommended Posts