Previously variable declaration required a keyword, e.g. ```kcl let x = 4 const x = 4 var x = 4 ``` These were all valid, and did the exact same thing. As of this PR, they're all still valid, but the KCL formatter will change them all to just: ```kcl x = 4 ``` which is the new preferred way to declare a constant. But the formatter will remove the var/let/const keywords. Closes https://github.com/KittyCAD/modeling-app/issues/3985
26 KiB
26 KiB
title, excerpt, layout
| title | excerpt | layout |
|---|---|---|
| assert | Check a value at runtime, and raise an error if the argument provided | manual |
Check a value at runtime, and raise an error if the argument provided
is false.
assert(data: bool, message: string) -> ()
Arguments
| Name | Type | Description | Required |
|---|---|---|---|
data |
bool |
Yes | |
message |
string |
Yes |
Returns
()
Examples
myVar = true
assert(myVar, "should always be true")