Node.js console.dirxml() Method
Last Updated :
10 May, 2021
The console.dirxml() method calls console.log() method by passing the received argument, this element does not produce any XML formatting.
Syntax:
console.dirxml(object_or_element)
Parameters: This function accepts the following parameter:
- object: This method take a JavaScript object or element.
Return Value: This method returns the object or element passed.
Below examples illustrate the use of process.memoryUsage() method in Node.js.
Example 1:
index.js
const console = require( 'console' );
var a = 'GeeksforGeeks' ;
console.dirxml(a)
|
Run the index.js file using the following command:
node index.js
Output:
GeeksforGeeks
Example 2: Create an index.js file with the following code.
index.js
const console = require( 'console' );
console.dirxml( "Hi there, Geeks" )
|
Run the index.js file using the following command:
node index.js
Output:
Hi there, Geeks
Reference: https://nodejs.org/api/console.html#console_console_dirxml_data
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...