Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

try

Description

The try of Statements for JS executes code that may throw an exception.

When the exception is caught, more code may be executed.

Syntax

try-catch

try
{
    code
}
catch(exception)
{
    code
}

try-finally

try
{
    code
}
finally
{
    code
}

try-catch-finally

try
{
    code
}
catch(exception)
{
    code
}
finally
{
    code
}

Examples

1 · try-catch

2 · try-finally

3 · try-catch-finally

if

switch

European Computer Manufacturers Association (ECMA)

HomeMenu