Go for option 3:
var x = {
a: 10,
b: 20,
// etc
};
Don't declare x as a empty object, only to replace it with an object with an a property.
When you need to set a large amount of properties on a object, using a object literal like that is more efficient than adding every single property separately. However, the difference will be negligible.
The disadvantage of option #1 is:
1 operation for every single property to add to the object, which will have an effect when larger amounts of properties are required.
The disadvantage of option #2 is:
You're declaring the object, then replacing it completely.
My suggestion simply adds all required properties to the object in one go, without replacing the variable.
x = {a: 10};replaces the old object thatxwas pointing to with{a: 10}. There is no point to initializingxto equal{}.