»Ë»Ñ Æ÷·³

[JavaScript] Strings and Template Literals

 

20240709095320_Yi4LLYwZX4.jpeg

 

 

20240709095323_FIlf0hvKmJ.jpeg

 

 

20240709095330_jeJVECjMEw.jpeg

 

:

(1) JavascriptÀÇ template literalÀº Go ¾ð¾îÀÇ fmt.Printf(), PythonÀÇ ¹®ÀÚ¿­ ¸Þ¼­µå format()¿Í ºñ½ÁÇÏ´Ù.


(2) ±×¸² 1: Template literals sort of assemble the string using the pieces (of strings) given. It is one of the most used ES6 features. 


(3) ±×¸² 2: You can actually use backticks(`) like single quotes (¡®) and double quotes (¡°) without introducing ${}, and write all strings. And many developers actually started using backticks for all strings.


(4) ±×¸² 3: Another great use of template literals and backticks(`) is to create multiline strings.  It comes in handy when building HTML from Javascript. ¹Ù²ã ¸»ÇØ, Go ¾ð¾îÀÇ raw string literal°ú ºñ½ÁÇÔ.


(5) Whenever you need a multiline string, you always make sure to use template literals.

 

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°
÷ºÎÆÄÀÏ
  • IMG_8522.jpeg
  • IMG_8523.jpeg
  • IMG_8524.jpeg
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û