반복되는 문자열 생성
const BLANK = "_";
const result = BLANK.repeat(number);
문자열 합치기
1. +연산
const a = "_";
const b = "+";
const c = "-";
const result = a + b + c;
2. list to string (join)
const a = "_";
const b = "+";
const c = "-";
const result = [];
result.push(a,b,c);
result.join("");
성능 비교
(1) 59175 ms vs (2) 220 ms
https://stackoverflow.com/questions/2087522/does-javascript-have-a-built-in-stringbuilder-class
'개발일지 > Javascript' 카테고리의 다른 글
[Javascript] array sort 다중 조건 (0) | 2021.09.24 |
---|---|
[JWT] 클라이언트에서의 관리 (0) | 2021.08.27 |
Java와 JavaScript의 차이점 (0) | 2021.05.16 |
[axios] 이중으로 비동기 요청시 proxy 설정 error (0) | 2020.10.10 |
[Nginx] 502 error (0) | 2020.08.04 |