Is there a way I can do all of this in a constructor?
obj = new Object(); obj.city = \"A\"; obj.town = \"B\";
You can write your custom constructor :
function myObject(c,t) { this.city = c; this.town = t; } var obj = new myObject("A","B");