try Block
A block containing code that may throw an exception.
What is try Block in JavaScript?
try Block — A block containing code that may throw an exception.
function reserve(seats) {
if (seats < 1) {
throw new Error("Seat count must be positive");
}
}
Level: Journeyman · More JavaScript terms at this level
Updated