In the first lines, you declare and give a value to your variables (that's why you use "var" before, although it isn't obligatory in expressions).
Then, in the last line(s), you use these variables to assign a value to your property (position in your cases). The brackets are there to express a multi-value property (x,y or x,y,z for position / x,y,z rotation, etc...)
Other properties (like 2d rotation) only take one value, so you don't use the brackets.
Hope this clarifies things a bit for you 😉