I want to know how you can read what type of storage object is "this"? Say you got this function:
Storage.prototype.typeOf=function(){return this;}
You will now see the data in sessionStorage or localStorage. But how to get this information in JS code? I tried
Storage.prototype.typeOf=function(){
var x=this;
alert(this)
}
It only returns [object Storage], but this is obviously not what I was looking for.
I looked at the available storage type methods, but no one returned the real type. Is there any way to get this information?
source
share