FAQ: Welcome to Codecademy! - Changing Variables

This community-built FAQ covers the “Changing Variables” exercise from the lesson “Welcome to Codecademy!”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development
Code Foundations

Welcome to Codecademy!

FAQs on the exercise Changing Variables

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

2 posts were merged into an existing topic: How does bounceBubbles() work?

5 posts were split to a new topic: Error message on Welcome lesson [solved]

3 posts were split to a new topic: How is the letter colors determined?

3 posts were split to a new topic: Are empty lines okay to have?

Why the variable message defined without any of keywords var, let or const in index.js ?

Why is everything black and blurred out? How do I start my exercise like this?

When that happens, refreshing your browser usually fixes it.

On the change the message exercise, if I wanted to include a word that has an apostrophe, how would I be able to do that without cutting off the rest of my message after an apostrophe is used?

Hello, @cfpalmer.

You can use the escape character \ to include special characters in a string literal. For example,

my_string = 'My dog\'s name is \'Hurley,\' and he\'s 7 years old.' 
print(my_string)

Output:

My dog’s name is ‘Hurley,’ and he’s 7 years old.

You can also use single quotes inside double quotes or double quotes inside single quotes without the escape character:

print("My dog's name is Hurley.")
#output: My dog's name is Hurley.

print('I have a dog named "Hurley."')
#output: I have a dog named "Hurley."
1 Like

Hello,

I wanted to start, however the right side of the page is completely blank apart from “http://localhost:8000/” in the url bar. I’ve tried two different browsers and refreshed the page. How do I fix this?

Are there any code not only
Bouncebubble?

Can you clarify what you mean by your question?

The line bounceBubbles(); is a function call. This is a more complicated concept that will be taught if you take other courses on Codecademy. For now, focus on the point of this lesson: changing variable values. See what happens when you change the value of the variable message.

Welcome to the forums!

My new message was “I’m really excited to be here” and I noticed that the use of apostrophe (’) in “I’m” created a problem. Is it any way to fix it?

Captura de pantalla 2021-01-31 a la(s) 10.49.49

Welcome to the forums, @code9479679630 .

When we wish to use an apostrophe in our printable text, then the string itself should be enclosed in double quotes so as not to conflict with the apostrophe.

"I'm really excited to be here."
2 Likes

What does the // at the very top mean? does it ignore everything until the first enter?

It’s used to create a comment here-

2 Likes

Does anyone know if you can make two messages pop up on the screen using both message and message1 for example?

1 Like

What if you have multiple message variables with different text in it.
For example:
message = ‘airplane’;
message = ‘car’;
message = ‘tank’;
drawName(message);

If you run the above code, the browser panel shows ‘tank’. Why it’s showing the last one and not the 1st one or why not all of them?

I think you can try:
drawName(message + message1);
and then it will show both texts on those messages