FAQ: Variables - String Interpolation

This community-built FAQ covers the “String Interpolation” exercise from the lesson “Variables”.

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

Learn Swift

FAQs on the exercise String Interpolation

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

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

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in #get-help.

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

Need broader help or resources? Head to #get-help and #community:tips-and-resources. If you are wanting feedback or inspiration for a project, check out #project.

Looking for motivation to keep learning? Join our wider discussions in #community

Learn more about how to use this guide.

Found a bug? Report it online, or post in #community:Codecademy-Bug-Reporting

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!

Could someone help me? I am doing the " Race Day Project" and it is going well except my ‘string interpolation’ part. It didn’t execute whenever I used ‘string interpolation’ code. It is happened not only in this project but also another project so I think something is wrong. Please see my quotes below. I tried with many different ways like ‘copying exact words from hint section’ or ’ copying exact string interpolation code from other projects ’ but still it didn’t execute. I don’t know where is wrong ? is something I need to download to execute ‘string interpolation’ or to work well ‘string interpolation’ code? Could someone advise what to do ? There is nothing wrong other parts of code and all runs well.


It showed code but not a number ( please see below )

they will race at 11:00 am. Their raceNumber is ${raceNumber}

let raceNumber = Math.floor(Math.random() * 1000);

const registeredEarly = false ;

let runnerAge = 20;

if (runnerAge >18 && registeredEarly ) {
raceNumber += 1000 ;
if (runnerAge>18 && registeredEarly) {
console.log (‘they will race at 9:30 am. Their raceNumber is {raceNumber}'); } else if (runnerAge >18 && !registeredEarly) {console.log ('they will race at 11:00 am. Their raceNumber is {raceNumber}’);

else if (runnerAge <18) {
console.log(‘they will race at 12;30 pm. Their raceNumber is ${raceNumber}’);

console.log(‘the runner needs to see the resigtration desk.’);