Node.js console.log() Function
Last Updated :
14 Oct, 2021
The console.log() function from console class of Node.js is used to display the messages on the console. It prints to stdout with newline.
Syntax:
console.log( [data][, ...] )
Parameter: This function contains multiple parameters which are to be printed.
Return type: The function returns the passed parameters.
Below program demonstrates the working of console.log() function:
Program 1:
function GFG(name) {
console.log( "hello " + name);
}
GFG( "Geeksforgeeks" );
|
Output:
Program 2:
function GFG(name) {
console.log( "hello " + name);
}
GFG();
|
Output:
Share your thoughts in the comments
Please Login to comment...