> 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(self, other: 'Var') -> 'bool'` | Check if two vars are equal. |
| `create(cls, value: 'OTHER_VAR_TYPE', _var_data: 'VarData \| None' = None) -> 'Var[OTHER_VAR_TYPE]'` | Create a var from a value. |
| `to(self, output: 'type[OUTPUT] \| types.GenericType', var_type: 'types.GenericType \| None' = None) -> 'Var'` | Convert the var to a different type. |
| `guess_type(self) -> 'Var'` | Guesses the type of the variable based on its `_var_type` attribute. |
| `bool(self) -> 'BooleanVar'` | Convert the var to a boolean. |
| `is_none(self) -> 'BooleanVar'` | Check if the var is None. |
| `is_not_none(self) -> 'BooleanVar'` | Check if the var is not None. |
| `to_string(self, use_json: 'bool' = True) -> 'StringVar'` | Convert the var to a string. |
| `js_type(self) -> '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(cls, first_endpoint: 'int \| NumberVar', second_endpoint: 'int \| NumberVar \| None' = None, step: 'int \| NumberVar \| None' = None) -> 'ArrayVar[Sequence[int]]'` | Create a range of numbers. |
