른록노트

[NodeJs] 노드에선 replaceAll 대신에 replace를 사용 본문

Web/[NodeJs]

[NodeJs] 노드에선 replaceAll 대신에 replace를 사용

른록 2020. 9. 9. 18:11

@ 예시

let text = "test입니다";

 

//text = text.replaceAll("test",""); 사용불가능

text = text.replace(/test/g,""); 

 

console.log(text);

=> "입니다"

 

@ 참고사이트

stackoverflow.com/questions/13340131/javascript-replaceall-not-working

 

반응형
Comments