Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Template Literals for Strings

const str1 = 'This is a string';

// cannot use the same quotes
const str2 = 'A "quote" inside a string';  // valid code
const str3 = 'A 'quote' inside a string';  // Error

const str4 = "Another 'quote' inside a string"; // valid code
const str5 = "Another "quote" inside a string"; // Error
Source by learn.codeinstitute.net #
 
PREVIOUS NEXT
Tagged: #Template #Literals #Strings
ADD COMMENT
Topic
Name
6+4 =