Any help would be appreciated. Word Blanks

Tell us what’s happening:
I have tried others. Went to the hint page. I still don’t really understand what to do here.

Your code so far


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "";

  // Your code above this line
  result += "my " + myAdjective + myNoun + myVerb + "very " + myAdverb;
 return result; 
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks/

When I test your code the errors are:
wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).

wordBlanks("cat", "little", "hit", "slowly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).

“Separated by non-word characters” - you need spaces between the words.

Could you give me an example please? I thought I did use spaces in those words. I’m just kinda done with this step. I have been here for like two days trying different things. Including what it said in the hints and the code still didnt work.

The 2nd test case returns 'my bigdogranvery quickly' when calling your function. Does that look like a sentence to you? You need some spaces.

I get that, but how do I add space to the parameters in the function?

would it be (‘my’ + ’ adjective’ + ’ noun’ + ’ verb’ + ’ adverb’);

I got it. It was stupid. lol. Thank you.

1 Like

Glad you got it. I would have given an example if you didn’t get it because I’ve been there staring at code wondering why it doesn’t work and when I finally (with help) see the error I’m like “Doh!”. And then it seems obvious but when you’re (I) staring at it, the error can be hard to see.

Yea, it happens to me a lot. I have only been learning for like a month or so. I basically restarted JavaScript here, because I couldn’t get the hang of it. I did the intro to js on Khan and also did html/js making webpages interactive. I understood most of it during the lessons. But when it came to executing it outside of that to make a practice website and stuff. It’s like I didn’t know what to do. So I’m starting fresh here. Thank you.

I’ve been learning on fcc for about 4 months. It takes me about a month to get each certificate. I’m just about to start the Apis and Microservices Projects. If you continue on fcc past JavaScript you will need to google more and consult outside websites more often to learn the subjects. It’s frustrating at times but that is the real world I guess when learning a new language. I also used w3schools.com, docs for the language, and when I got stuck with errors: google, stackoverflow, pasting my code into a word processor to catch misspellings, and coding in a code editor like sublime or visual studio code.

Yea, that’s what I need to do. Probably google more, I have a github account but have not used it much. Don’t really know how yet. I know about w3schools.com as well. My brother in law recommended it, he works in the industry and helps me when he can. He more or less just points me in the direction I need to go to find what I need to find lol. Khan is great, but idk if it’s just me struggling to learn or what. It’s not making want to quit. I really want to learn more. But it is frustrating doing it alone. lol. I use Atom to play around with code. I’m also on codepen to practice making a website. Baby steps i guess, I know I need to be patient. It will come to me. Thank you for your help. :slight_smile: