Returns the value of the supplied expression or returns the default value if the expression produces an error.
Syntax
|
Returns the value of the supplied expression or returns the default value if the expression produces an error. |
|
Safe(expression, defaultValue) |
|
Arguments: |
|
|
expression |
Expression - An expression. |
|
|
defaultValue |
Any - The default value to return if the expression argument produces an error. |
Remarks
- Example: Safe(1.0 / 0, null) returns null.
- Example: Safe(1.0 / 1.0, null) returns 1.0.
Comments
0 comments
Article is closed for comments.