> For AI agents: the complete documentation index is at [llms.txt](https://reflex.dev/docs/llms.txt). Markdown versions are available by appending `.md` or sending `Accept: text/markdown`.

# Var

`reflex_base.vars.base.Var`

Base class for immutable vars.

## Methods

| Signature | Description |
| --- | --- |
| `equals(other: Var) -> bool` | Check if two vars are equal. |
| `create(value: OTHER_VAR_TYPE, _var_data: Optional[VarData] = None) -> Var[OTHER_VAR_TYPE]` | Create a var from a value. |
| `to(output: type[OUTPUT] \| GenericType, var_type: Optional[GenericType] = None) -> Var` | Convert the var to a different type. |
| `guess_type() -> Var` | Guesses the type of the variable based on its `_var_type` attribute. |
| `bool() -> BooleanVar` | Convert the var to a boolean. |
| `is_none() -> BooleanVar` | Check if the var is None. |
| `is_not_none() -> BooleanVar` | Check if the var is not None. |
| `to_string(use_json: bool = True) -> StringVar` | Convert the var to a string. |
| `js_type() -> StringVar` | Returns the javascript type of the object.  This method uses the `typeof` function from the `FunctionStringVar` class to determine the type of the object. |
| `range(first_endpoint: int \| NumberVar, second_endpoint: Optional[int \| NumberVar] = None, step: Optional[int \| NumberVar] = None) -> ArrayVar[Sequence[int]]` | Create a range of numbers. |
