Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

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

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

Arguments

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

Example

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

Example

Code Block
languagejs
Script.Assert(isCompleted, "Operation is not completed");