This commit is contained in:
coderjojo
2020-11-24 13:35:44 +05:30
parent cb6ea41526
commit 33ee3b950e
3 changed files with 6 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ let myString1 = "Hello";
let myString2 = "World"; let myString2 = "World";
`${myString1} ${myString2}!` //Hello World! `${myString1} ${myString2}!` //Hello World!
`${myString1}, ${myString2}!` //Hello World! `${myString1}, ${myString2}!` //Hello, World!
``` ```
You can achieve your formatting goals with either method, but template literals will respect any spaces and line breaks. You can achieve your formatting goals with either method, but template literals will respect any spaces and line breaks.

View File

@@ -164,7 +164,7 @@ let myString1 = "Hello";
let myString2 = "World"; let myString2 = "World";
`${myString1} ${myString2}!` //Hello World! `${myString1} ${myString2}!` //Hello World!
`${myString1}, ${myString2}!` //Hello World! `${myString1}, ${myString2}!` //Hello, World!
``` ```
Sie können Ihre Formatierungsziele mit beiden Methoden erreichen, aber Vorlagenliterale berücksichtigen alle Leerzeichen und Zeilenumbrüche. Sie können Ihre Formatierungsziele mit beiden Methoden erreichen, aber Vorlagenliterale berücksichtigen alle Leerzeichen und Zeilenumbrüche.

View File

@@ -160,7 +160,7 @@ let myString1 = "Hello";
let myString2 = "World"; let myString2 = "World";
`${myString1} ${myString2}!` //Hello World! `${myString1} ${myString2}!` //Hello World!
`${myString1}, ${myString2}!` //Hello World! `${myString1}, ${myString2}!` //Hello, World!
``` ```
Puede lograr sus objetivos de formato con cualquier método, pero los literales de plantilla respetarán los espacios y saltos de línea. Puede lograr sus objetivos de formato con cualquier método, pero los literales de plantilla respetarán los espacios y saltos de línea.