Take a look at the sessionStorage
specification.
This line:
setter creator void setItem(DOMString key, DOMString value);
Tells us setItem
doesn't return anything. (void
is the return value, there)
You can check if the item was set like this:
if (sessionStorage.getItem('myValue') == null){
// myValue was not set
}else{
// myValue was set
}