Is there a way I can do all of this in a constructor?
obj = new Object(); obj.city = \"A\"; obj.town = \"B\";
function cat(name) { this.name = name; this.talk = function() { alert( this.name + " say meeow!" ) } } cat1 = new cat("felix") cat1.talk() //alerts "felix says meeow!"