Ok here is a message at all of you:
It’s really appreciated that you want answer the question and I’ve seen really good answers in the forum, but if you do so. Please do not post solutions with nothing but an imperativ tone: “Do it like this”. There are often many ways to do it and I hate to say this but none of the codes posted here marked as “the solution” is actually correct. If you answer a question try to find the error and give some hints how to fix it. And if you post your code at least explain a bit what you think is the critical point in it and what the concept is. The least best solution is that the OP copy pastes your solution doesn’t understand what is actually wrong and ends up frustrated because he/she fails on further exercises because the basics are missing. Thank you.
@aaronthekil From what I can see your problem is just the extra
! after Hi. The problem is that some exercises check for sentences or parts of sentences in a way like this
userInput.subsrt(...) == "Hi, I am ".Warning: This is pseudocode that is not how it is done just to give you an idea of how it might be done. So if you’re sentence differs from what is expected you get an error. As @ragezapper partially implies. As your code looks almost perfect also what @dracoslayer implies to refresh the page might be an option that works. But as said here there is a real problem so it won’t.
@all Susie is just an arbitrary name you could use any name here that you want. What happens is just that the code runs through some test and Susie seems to be the first name in this test so if it is correct you don’t even recognize anything if it is not it tells you that it expects the output “Hi, I am x” for the function call nameString(x). Why x is Susie. Idk maybe it’s the authors girlfriend maybe it’s just random anyway this does not matter any trying to trick the exercise by using Susie does not help.
Last but not least:
This is a commom problem because many don’t seem to understand that call and console.log only mean the order in which it is done but not that this should be two statements. If someone knows a better wording please go ahead. Still what is meant is what the OP used:
What happens here:
is that you call the namestring function get the result and dump it as it is never used again. Also as @scriptdolphin you need to make your argument a string. So it would rather be
otherwise you would confuse it with a variable. And:
this is just printing the function name so what you see on the screen should be [Function] because well nameString is a function. To get the expected string you need to call the function with an appropriate argument (the value in () after the function).
As you can see not all of your answers are wrong and as said answering the questions is well appreciated but please try to do it in a less imperative and more helpful way: