Throw

throw: 현재 함수의 실행을 중단하고, 즉시 해당 오류를 발생시킵니다. 이 오류는 가장 가까운 상위의 try...catch 블록에서 잡히게 됩니다.

만약 try...catch 블록이 없다면, 오류는 전역 범위로 전파되어 프로그램의 실행을 중단시킬 수 있습니다.

ex)

throw new Error("[ERROR] 잘못된 값을 입력하였습니다.");

This line appears after every note.

Notes mentioning this note


Here are all the notes in this garden, along with their links, visualized as a graph.