I\'m using an object as a hash table. I\'d like to quickly print out its contents (for alert() for instance). Is there anything built in to convert a hash into
alert()
Since you want to alert it out I assume it's not for your production version, and that old browser compatibility is not an issue.
alert
If this is the case, then you can do this:
var myHash = ...... alert(Object.keys(myHash).map(function(key) { return [key, myHash[key]]; }));