console.log object object
const language = this.converstaionLanguage; // {"lang":"en"} <- this is JSON
console.log(language); // [object Object]
console.log(JSON.stringify(language) // {"lang":"en"}
console.log object object
const language = this.converstaionLanguage; // {"lang":"en"} <- this is JSON
console.log(language); // [object Object]
console.log(JSON.stringify(language) // {"lang":"en"}
nested array of object shows as object in console log output js
const util = require('util')
console.log(util.inspect(myObject, {showHidden: false, depth: null}))
// alternative shortcut
console.log(util.inspect(myObject, false, null, true /* enable colors */))
javascript log html element as dom object
var el = document.getElementById("myId");
console.log(el); // logs the html of element <div>…</div>
console.dir(el); // logs the element’s properties and values
what is log method in javascript
var str = "Howdy GeeksforGeeks"
var geek = {
book: "harrypotter",
price: "2000"
};
var geek2 = [10, 20, 30];
console.log(str);
console.dir(str);
console.dir(geek);
console.log("geek (log) = ", geek);
console.dir(geek2);
console.log("geek2 (log) = ", geek2);
// Prints only string as dir() takes
// only one parameter.
console.dir("geek2 (dir) = ", geek2);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us