Constants
Constants are variables that cannot be mutated after their declaration, they are scoped to the module level and they can hold values of any type.
info
Variables in Knot are immutable except for within the scope of state entities (coming soon!).
- Knot
- TypeScript
knot
const empty = nil;const boolean = true;const integer = 1234;const float = 56.78;const string = "this is a string";const element = <div />;
knot
const empty = nil;const boolean = true;const integer = 1234;const float = 56.78;const string = "this is a string";const element = <div />;
tsx
const empty = undefined;const boolean = true;const integer = 1234;const float = 56.78;const string = "this is a string";const element = <div />;
tsx
const empty = undefined;const boolean = true;const integer = 1234;const float = 56.78;const string = "this is a string";const element = <div />;