Pour afficher un objet ou une variable javascript (comme la fonction var_dump de PHP), on peut utiliser
console.log (JSON.stringify (variable));