javascript - How can I see the output of console.log()? - Stack Overflow
jquery - Console.log messages not showing up in Chrome's javascript console? - Stack Overflow
javascript - How can I make console.log show the current state of an object? - Stack Overflow
How to read from Chrome's console in JavaScript - Stack Overflow
Videos
Sorry this may be a dumb question- but I’m learning JavaScript. When do you ACTUALLY need console.log() ? I’m confused about it since we can use Var or let for stating variables . What’s the actual importance of console.log()
You can open the error console, depending on your browser. (Ctrl+Shift+J in Firefox, or F12 in Chrome, for example). Most browsers have the console hidden in their developer tools.
The console.log(); statement prints anything in the browser console.
Look for Developer Tools or Simply Tools menu in all major browsers.
If you are using Google Chrome the press Cntrl+shift+j to see console.
In Firefox, press Ctrl+Shift+I and click on Console to view the console on Firefox.
Make sure you have the console showing and that it is showing "All".
The cursor is on the button to hide/show the console.
Update: In newer versions of Chrome, you need to click the filter icon, then make sure "All" is selected.

I've just had the same problem and found this question when trying to find an answer.
What fixed this for me was disabling firebug lite in chrome. It was swallowing all console messages.
I think you're looking for console.dir().
console.log() doesn't do what you want because it prints a reference to the object, and by the time you pop it open, it's changed. console.dir prints a directory of the properties in the object at the time you call it.
The JSON idea below is a good one; you could even go on to parse the JSON string and get a browsable object like what .dir() would give you:
console.log(JSON.parse(JSON.stringify(obj)));
What I usually do if I want to see it's state at the time it was logged is I just convert it to a JSON string.
console.log(JSON.stringify(a));
You can't. What's in the console can't be read from JavaScript.
What you can do is hook the console.log function so that you store when it logs :
console.stdlog = console.log.bind(console);
console.logs = [];
console.log = function(){
console.logs.push(Array.from(arguments));
console.stdlog.apply(console, arguments);
}
console.logs contains all what was logged. You can clean it at any time by doing console.logs.length = 0;.
You can still do a standard, non storing, log by calling console.stdlog.
get all console data
how to read browser console error in js?
How to read from Chrome's console in JavaScript
https://www.quora.com/How-do-I-read-console-window-errors-from-Chrome-using-JavaScript
logs
console.defaultLog = console.log.bind(console);
console.logs = [];
console.log = function(){
// default & console.log()
console.defaultLog.apply(console, arguments);
// new & array data
console.logs.push(Array.from(arguments));
}
error
console.defaultError = console.error.bind(console);
console.errors = [];
console.error = function(){
// default & console.error()
console.defaultError.apply(console, arguments);
// new & array data
console.errors.push(Array.from(arguments));
}
warn
console.defaultWarn = console.warn.bind(console);
console.warns = [];
console.warn = function(){
// default & console.warn()
console.defaultWarn.apply(console, arguments);
// new & array data
console.warns.push(Array.from(arguments));
}
debug
console.defaultDebug = console.debug.bind(console);
console.debugs = [];
console.debug = function(){
// default & console.debug()
console.defaultDebug.apply(console, arguments);
// new & array data
console.debugs.push(Array.from(arguments));
}
Technically console.log console.debug and console.info are identical
However the way they display the data is little different. console.debug is not visible by default in the browser's JS console. It can be enabled by using the console's filter options.
console.log Black color text with no icon
console.info Blue color text with icon
console.debug Pure black color text
console.warn Yellow color text with icon
console.error Red Color text with icon
Copyvar playerOne = 120;
var playerTwo = 130;
var playerThree = 140;
var playerFour = 150;
var playerFive = 160;
console.log("Console.log" + " " + playerOne);
console.debug("Console.debug" + " " +playerTwo);
console.warn("Console.warn" + " " + playerThree);
console.info("Console.info" + " " + playerFour);
console.error("Console.error" + " " + playerFive);
Run code snippetEdit code snippet Hide Results Copy to answer Expand

For at least IE, Firefox and Chrome consoles, .debug() is just an alias for .log() added for improved compatibility
https://developer.mozilla.org/en-US/docs/Web/API/console
https://developers.google.com/chrome-developer-tools/docs/console-api#consoledebugobject_object
https://msdn.microsoft.com/en-us/library/ie/hh772183(v=vs.85).aspx