Assignment 1 candidate name

I am having an issue with trying to define the candidates name. I have been going back and forth between the book and my program and everything looks okay to me. Why will my program not accept my input when asked?

I believe I just found the issue but am still unsure of what the assignment asks. I managed to move 1.1c into 1.1a and I get the result I am looking for. Is there a specific reason as to why we need two areas to ask for their name?

Just found out the issue I was having, the assignment uses functions and calls. Make sure to read that section and things will be smooth sailing.

1 Like

I am also having issues… in 1.1c I have:
console.log(Greetings ${candidateName}!)

but in the console it just comes out “Greetings !”

I can’t remember having this issue before… I’ve tried moving things around and it is like the template literal is not calling my variable (candidateName) for some reason. Everything looks right in 1.1b, so I don’t know why it wouldn’t be storing the variable. When I call it in the function in 1.1b it works, but not outside it. What am I missing?

I figured it out… since I had already declared the variable in 1.1a, I should not have included “let” in my function on 1.1b.

Once I took that out it worked like a charm.

Not sure if anyone else is getting same error:
Error: Cannot find module ‘readline-sync’
Since we are not supposed to modify any files other than candidate-testing.js I am not sure how to address this as all my research points to a dependency in another file…

I ended up deleting Repl and recreating it to resolve the issue…

If you go to the GitHub classroom repo then click to work it in repl.it the files will all be pulled in.

Is the template literal required to be in the code? I got the name to display but through a variable instead of template literal.