Posted By

virua on 10/16/10


Tagged

javascript vardump


Versions (?)

var_dump in JavaScript


 / Published in: JavaScript
 

  1. function dump(obj) {
  2. var out = '';
  3. if(obj && typeof(obj) == 'object'){
  4. for (var i in obj) {
  5. out += i + ": " + obj[i] + "\n";
  6. }
  7. } else {
  8. out = obj;
  9. }
  10. alert(out);
  11. }

Report this snippet  

You need to login to post a comment.