Word Blanks help and adwise

Tell us what’s happening:
Im trying to solve this but i cant. Where is my mistake ? Please I need help.

Your code so far


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  myNoun ="dog ";
  myAdjective= "big ";
  myVerb = "ran ";
  myAdverb = "quckly ";
  g = "cat ";
  b = "little ";
  d = "hit ";
  c = "slowly ";
  
 var result = "My " + myAdjective + myNoun + "saw a " + "b " + "g " + "and " + "d " + "her " + "c " + myVerb + "and run " + myAdverb;


  // Your code above this line
  return result;
}

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

Your browser information:

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

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

first you need to declare you variables g, b, d, and c

second you are printing literal strings on this line, not the g, b, d, c javascript variables you have defined
var result = "My " + myAdjective + myNoun + "saw a " + "b " + "g " + "and " + "d " + "her " + "c " + myVerb + "and run " + myAdverb;

2 Likes

Im still having problem with myNoun myAdjective…

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
myNoun ="dog ";
myAdjective= "big ";
myVerb = "ran ";
myAdverb = "quckly ";
var g = "cat ";
var b = "little ";
var d = "hit ";
var c = "slowly ";

var result = "My " + myNoun + myAdjective + "saw a " + "little " + "cat " + "and " + "hit " + "her " + "slowly " + myVerb + myAdverb;

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks(“dog”, “big”, “ran”, “quickly”, “cat”, “little”, “hit”, “slowly”);

solved. there was problem in my code with declaring var…

You dd not actually need to create any new variables to solve this challenge. You were only supposed to use the arguments passed into the function.

1 Like

Im just trying to better understand JS. Tnx for advice.