FAQ: Code Challenges: JavaScript Fundamentals - sillySentence()

It looks like you were missing an exclamation mark ! at the end of the sentence.

I think by placing quotation marks around adjective, etc you turned the parameters into strings. Also I think it may be missing an exclamation mark ! at the end of the sentence.

1 Like

I agree. I was stuck asking myself why can’t I proceed even though I wrote the correct code. The only issue was that there was a space between the word functions and the exclamation mark.

I just wanted to point out, that I made this code work but it still failed even though it passed in the console.log().

const sillySentence = (a='excited', b='love', c='functions') =>{
return `I am so ${a} because I ${b} coding! Time to write some more awsome ${c}!`
}```

I can’t get this to pass. Did I miss something silly?

const sillySentence = (adjective, verb, noun) => {
 return 'I am so ${adjective} because I ${verb} coding! Time to write some more awesome ${noun}!'
}

console.log(sillySentence('excited', 'love', 'functions')) 

You’re using: ’ instead of: `

Hey guys! Hopefully, this will reach as many people as possible!

If you are getting the error that is asking if you used string concatenation or interpolation try checking your strings grammar. I spent almost 30 mins on this before I realized that I was missing an ‘!’ at the end of the string! As long as your code is sound and it prints out the string that should work. You just have to make sure it matches the picture prompt on the side!

Best of luck!

1 Like

I agree. My code was spot on except for the fact that I used curly brackets. Im not sure, but I think this might have to do with the fact that both of our codes just don’t fit the Codecademy template answer.

Ok, so my question is… If I use curly brackets in this function expression is that acceptable? I got rid of them (the ones that hold the function value) and my code worked, but I don’t know why using the curly brackets would be incorrect. I have used curly brackets in all of my past function expressions regardless of number of parameters and have never had a problem before this exercise.