Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

console.log javascript [Function]

People also ask

What is console log in JavaScript?

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.

How do you console in JavaScript?

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()

Where does console log to JavaScript?

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.

What is console log method?

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);