Run ❯
Get your
own Node
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
// @ts-check function divide(a, b) { if (b === 0) { throw new Error('Division by zero'); } return a / b; } try { const result = divide(10, 0); console.log(result); } catch (error) { if (error instanceof Error) { console.log('An error occurred:', error.message); } else { console.log('An error occurred'); } }
An error occurred: Division by zero