I'm not sure about the specifics, which are implementation dependent, but here's what I'd guess.
Simply doing var foo;
doesn't create any new objects. However, foo might need to be added to a dictionary of declared variables in which case space for the string foo
and possible metadata is allocated, assuming it isn't interned.
When you do var foo = 10;
or var foo = "this is random"
it creates string or integer variables respectively, which would normally take up memory. However small ints and constant strings are almost certainly interned. Plus the JIT might optimize away the number reference to a plain machine integer, which case it doesn't take any extra memory at all.
Anyway, it's hard to say much specific about performance in a high level language with varying implementations, especially when a JIT is involved.