#MOC [[🗃️JavaScript]]の[[🗃️例外処理]] ```js function getRectArea(width, height) { if (isNaN(width) || isNaN(height)) { throw new Error('Parameter is not a number!'); } } try { getRectArea(3, 'A'); } catch (e) { console.error(e); // Expected output: Error: Parameter is not a number! } ``` ## 📚ドキュメント - [throw - JavaScript | MDN](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Statements/throw) ## 📖ノウハウ ## 💁トラブルシューティング