* updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * empty --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
35 lines
94 KiB
Markdown
35 lines
94 KiB
Markdown
---
|
|
title: "assert"
|
|
excerpt: "Check a value at runtime, and raise an error if the argument provided"
|
|
layout: manual
|
|
---
|
|
|
|
Check a value at runtime, and raise an error if the argument provided
|
|
|
|
is false.
|
|
|
|
```js
|
|
assert(data: bool, message: string) -> ()
|
|
```
|
|
|
|
### Examples
|
|
|
|
```js
|
|
const myVar = true
|
|
assert(myVar, "should always be true")
|
|
```
|
|
|
|

|
|
|
|
### Arguments
|
|
|
|
* `data`: `bool` (REQUIRED)
|
|
* `message`: `string` (REQUIRED)
|
|
|
|
### Returns
|
|
|
|
`()`
|
|
|
|
|
|
|