ציטוט:
The try...catch statement allows you to test a block of code for errors. The try block contains the code to be run, and the catch block contains the code to be executed if an error occurs.
|
אתה מריץ שם קוד, אם הקוד לא מתבצע ומחזיר שגיאה - בחלק של ה
קוד:
catch(err)
{
//Handle errors here
}
אתה מחזיר את השגיאה שתופיע או הקוד שיבוצע אם יש שגיאה..