diff --git a/14_Day_Error_handling/14_day_error_handling.md b/14_Day_Error_handling/14_day_error_handling.md index 696db4a..5a7cb8a 100644 --- a/14_Day_Error_handling/14_day_error_handling.md +++ b/14_Day_Error_handling/14_day_error_handling.md @@ -118,7 +118,7 @@ const throwErroExampleFun = () => { let x = prompt('Enter a number: ') try { if (x == '') throw 'empty' - if (isNaN(x)) throw 'not a number' + if (!Number.isFinite(x)) throw 'not a number' x = Number(x) if (x < 5) throw 'too low' if (x > 10) throw 'too high'