Use sessionStorage.setItem() over sessionStorage[]
Use sessionStorage.setItem() over sessionStorage[]

Per @akainic, the sessionStorage is mostly defined in terms of setItem
and getItem. In fact, 4.1 of
https://www.w3.org/TR/webstorage/#dom-storage-setitem only says:

   The supported property names on a Storage object are the keys of each
   key/value pair currently present in the list associated with the object.

This could be interpreted to mean that the property only exists after
setItem() has been called.

Chrome 47 does indeed make sessionStorage["foo"] = "bar" equivalent to
sessionStorage.setItem("foo", "bar") but why chance it for syntactic
sugar?

department-of-veterans-affairs/vets-website,department-of-veterans-affairs/vets-website