# When declaring a variable

**URL:** <https://forum.kirupa.com/t/when-declaring-a-variable/92135>\
**Category:** Uncategorized\
**Created:** [October 13, 2003, 8:00pm UTC](https://forum.kirupa.com/t/when-declaring-a-variable/92135 "2003-10-13T20:00:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jeremy](https://forum.kirupa.com/u/jeremy)\
**Post date:** [October 13, 2003, 8:00pm UTC](https://forum.kirupa.com/t/when-declaring-a-variable/92135/1 "2003-10-13T20:00:01Z")

</div>

when declaring a variable how important is it to use “var”  
[AS]var myVar1 = 2;[/AS]  
vs.  
[AS]myVar1 = 2;[/AS]

is it just preference/someting from another language that you are used to, or have you noticed problems when you leave it out. I think I have used it both ways, but would like to avoid any possible problems that might occur.

and when referring to it do you use var, or skip it.
