My var's don't work within quotes?

what is:

TypeError: undefined is not an object (evaluating ‘v.t0.actual’)

This challenge:

If you want to use variables that hold strings, you should review this challenge.

1 Like

im doing this challenge:

I know. But you said that you want to put strings inside of variables names FirstLine, SecondLine, etc, and change the final string based upon those variables, right?

If you want to do that, then you should review the challenge about putting strings inside of variables and concatenating them together.

You should put the three variables first, like @Jagaya said, and then you should look at the Word Blanks challenge to see how to use variables holding strings to make new strings.

i am doing a word bank challange.

1 Like

now i got this:

var FirstLine = “hello”;

var SecondLine = “im learning a lot”;

var ThirdLine = “have a nice day”;

const myStr = “FirstLine\n\tSecondLine\nThirdLIne”; // Change this line

and its not working

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

So you’re halfway there. In Word Blanks, you do something like:

let myNoun = "dog";
let myVerb = "ran";
let wordBlanks = "The" + " " + myNoun + " " + myVerb;

You should do something similar here:

const myStr = “FirstLine\n\tSecondLine\nThirdLIne”; // Change this line
1 Like

but when i look at what other people did it looked a lot different

That’s because this challenge doesn’t want you to change the text "FirstLine", "SecondLine", and "ThirdLine" at all (Which is what @ilenia and @Jagaya were talking about originally).

Combining this lesson and Word Blanks is a cool idea and a good thing to practice, but doing this won’t produce code that passes for this challenge.

Please keep in mind, the courses are done in single challenges. There are a lot of challenges so you need to give us some info on “where” you have looked at people doing things that look different.

You posted code that looked like it should solve the challenge. Are you done? Then please open a new topic if you got an unrelated question.
Are you not done? Then let’s focus on your almost-working code.

Did people write something wildly different? No, no they don’t. These challenges offer were little room for alternative solutions because they are very short.
If you come across wildly different code for THIS challenge, go ahead and share it, so we can look at it and maybe explain why it is so different. But again, this challenge is not very complex. You write like 6 words and 4 escape-characters in one specific order in one line.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.