The console. log() method outputs a message to the web console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects. Note: This feature is available in Web Workers.
In JavaScript, the console is an object which provides access to the browser debugging console. We can open a console in web browser by using: Ctrl + Shift + I for windows and Command + Option + K for Mac. The console object provides us with several different methods, like : log()
By default, the Inspect will open the "Elements" tab in the Developer Tools. Click on the "Console" tab which is to the right of "Elements". Now you can see the Console and any output that has been written to the Console log.
The console.log() method is used to write messages to these consoles. For example, let sum = 44; console.log(sum); // 44. Run Code.
If it's a user defined function you can use:
console.log(callback.toString());
Otherwise you'll just get something like [native code]
since built in functions are not written in JavaScript.
Example:
function x(){}
// Prints "function x(){}"
(function(callback){ console.log(callback.toString()); })(x);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With