본문 바로가기

Development/HTML & CSS & Javascript

[Javascript Error] Uncaught TypeError: Cannot read properties of null (reading 'replace') 오류 해결

⛔ 오류메세지

Uncaught TypeError: Cannot read properties of null (reading 'replace')

 

 해결방법

객체에 null 값이 들어갔는데 replace() 메소드를 호출해서 발생한 에러였다.

값을 받아온 이후에 null 값이 아니면 replace()를 실행하도록 하여 해결하였다.