First, remember that dog.species = dog["species"] = "bulldog" And if we say: var x = "species" then dog[x] = "bulldog"