Loading
Current section: 1. Expressions And Output 7 exercises
Problem

Escaping Strings

Loading exercise

Transcript

00:00 Now, we do have these strings but we're using those quotes. And you remember how in the last exercise we had to switch between double quote and single quote based on what the contents of the string were? Well, what if you're using single quotes and you need to both use an apostrophe and use double quotes inside of there? Which are you going to use? Well, it turns out that there's a mechanism for escaping those special kinds of characters.

00:22 The other thing to consider is like what about multiple lines? What if I've got like a whole bunch of things I need to say all in one big string? Well, the syntax for a string, it needs everything to be on a single line. So what are we gonna do about that? What if I wanna tab character?

00:37 A whole bunch of others. There's actually a lot of different ways to, what we call escape characters inside of a string so that they're interpreted special in a special way by the JavaScript compiler that's actually running on the code that we're passing to it. So in this exercise, you are going to be using some of those escape sequences and getting a little bit better idea of how all of that works together. So I'm gonna let you work on this one. We'll see you when you're done.