Declaring Strings with Quotes Inside
Let's follow the steps:
-
Declare a variable named
message
with the valueI'm learning JavaScript!
.const message = "I'm learning JavaScript!";
-
Declare a variable named
quote
with the valueHe said, "JavaScript is fun!"
.const quote = 'He said, "JavaScript is fun!"';
-
Print the values of
message
andquote
to the console.console.log(message); console.log(quote);
Putting it all together:
const message = "I'm learning JavaScript!"; const quote = 'He said, "JavaScript is fun!"'; console.log(message); console.log(quote);