Tell us what’s happening:
worse written, and more confusing, your instructions could not possibly be, there are people here trying earnestly to learn some new skills. In order to do so your instructions have to be much more succinct.
I have read reread searched all over and this challenge is by far the most pathetically described and explained of the whole course, at this point i have no idea what I am doing wrong, and the replys of the testing are no help what so ever
Your code so far
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = "The " + myAdjective + myNoun + myAdverb + myVerb + " around the tree. ";
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
Your browser information:
User Agent is: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0.
Tell us what’s happening:
im not getting any feedback in the return result area, I a newb here and i see that there are many people with much more experiance than I have that can NOT understand this assignment, if some one with programing experiance cant understand this , how is a technological caveman as myself supposed to understand this?
Your code so far
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = "The " + "myAdjective " + "myNoun "+"myAderb "+"myVerb " +"around the tree. ";
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
Your browser information:
User Agent is: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0.
The results area will not print all of the values returned by your funciton. If you would like to inspect a value, you can use a console.log() statement and view your browser’s console. Another alternative is to use a tool like repl.it which has a built in “console” which prints returned results.
With this t doesn’t work because you changed all your variables to strings and so the values are not passed in anymore - be careful with where you put the quotes adding the spaces in
You are doing exactly the opposite things remember if you put something within " " elements you want to get the litteral string inside and if you work with variables you don’t have to put them inside a “”
let a = "text"
console.log(a) //expect output is text
and
let s = "text"
let result = s //<= see the difference between using a variable and litteral string ?
thanks I ll take a look at it ,
what does this phrase mean…wordBlanks(“dog”, “big”, “ran”, “quickly”) should contain all of the passed in words separated by non-word … what is it that they are refering to by …passed in words???
When you declare a function you can also add parameters to a function
The variables in the round parenthesis are parameters
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
Then a function is called like
wordBlanks(“dog”, “big”, “ran”, “quickly”)
And you pass in arguments (in the round parenthesis) that will be assigned as a value of the parameters of the function
A function returns a value, and wordBlanks(“dog”, “big”, “ran”, “quickly”) has the value of the string you build, because that is the thing returned with the return keyword
Functions are a thing that will be explained if you continue with the curriculum
@ArielLeslie, @ilenia I created a PR an attempt to simplify this challenge. So many campers get confused by the function syntax introduced here even though functions are not explained until several challenges later in the Basic JavaScript section. The intent of the challenge is to teach campers how to create new strings by concatenating variables and other strings, so I tried to capture that intent with my suggested changes.
See below for my proposed changes to the instructions and to the challenge seed code.
I think you change the example code to show that you need to put quotation marks around the spaces as to make them place holders, that was the only part of exercize that was not clear to me at all…
@tiroloquo That is a good point about the example. I will make the correction too. You would be amazed how many campers get confused by the function syntax though.
See below for my changes to the example with the spaces which will match the provided sentence.