Skip to content

Assert

Asserts that the condition is true. If not, an error is thrown.

1
myScript.Assert(condition: boolean, message: string):void

Parameters

boolean condition
    The condition to assert.

string message
    The message to display if the condition is false.

Remarks

Example

1
Script.Assert(DateTimeOffset.now.getDate() === 1, "Not a good day");

Example

1
Script.Assert(isCompleted, "Operation is not completed");