Answer:Is there an equivalent for var_dump (PHP) in Javascript

function dump(obj) {
var out = ”;
for (var i in obj) {
out += i + “: ” + obj[i] + “\n”;
}

alert(out);

// or, if you wanted to avoid alerts…

var pre = document.createElement(‘pre’);
pre.innerHTML = out;
document.body.appendChild(pre)
}

http://stackoverflow.com/a/323809

Published by

sornram9254

Ayutthaya Technical College/Voc.Cert.🛠️ | KMUTNB/B.S.Tech.Ed.⚙️ | Information Security Engineer 👨🏻‍💻| Penetration Tester👨🏻‍💻 | COYG🔴 Milan🔴⚫️ | Taylor Swift👩‍🎤 | ติ่งซีรีส์ญี่ปุ่น 🇯🇵

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.