Notice
Recent Posts
Tags
- interrupt
- dataflow modeling
- Linked List
- Recursion
- MUX
- 4bit parallel adder
- java
- behavior modeling
- LED
- atmega 128a
- interface
- sequential logic circuit
- structure
- Method
- atmega 128
- full adder
- half adder
- ctc mode
- structural modeling
- Comparator
- verilog
- fast pwm mode
- 8bit timer/counter
- behavioral modeling
- gpio
- Set
- ATMEGA128A
- normal mode
- timer / counter
- Algorithm
거북이처럼 천천히
JS - Template Literal 본문
1. Javascript 문자열 줄바꿈
1.1. escape 문자를 통한 문자열 줄바꿈
- 문자열에서 New Line을 뜻하는 '\n' 이스케이프 문자를 넣어주면 줄바꿈이 동작된다.
1.2. Template Literal를 통한 문자열 줄바꿈
- escape 문자를 통해 줄바꿈할 경우, 가독성이 떨어진다는 단점이 있기 때문에 이를 해결하고자 최신 문법인
Template Literal 사용한다.
- 문자열을 정의할 때 따옴표( ' 또는 " )를 사용하는 대신 백틱(`)을 사용하면 escape문자를 사용없이 입력한
그대로 문자열이 표현된다.
- Template Literal 내에서 변수를 집어넣고 싶다면 ${변수}를 통해 넣어 표현할 수 있다.
'Front-end > Javascript' 카테고리의 다른 글
JS - padStart, padEnd (0) | 2022.05.17 |
---|---|
JS - Date Object (0) | 2022.05.17 |
JS - setTimeout (0) | 2022.05.17 |
JS - setInterval (0) | 2022.05.17 |
JS - LocalStorage API (0) | 2022.05.17 |