- Node.js Tutorial
- Node.js - Home
- Node.js - Introduction
- Node.js - Environment Setup
- Node.js - First Application
- Node.js - REPL Terminal
- Node.js - Command Line Options
- Node.js - Package Manager (NPM)
- Node.js - Callbacks Concept
- Node.js - Upload Files
- Node.js - Send an Email
- Node.js - Events
- Node.js - Event Loop
- Node.js - Event Emitter
- Node.js - Debugger
- Node.js - Global Objects
- Node.js - Console
- Node.js - Process
- Node.js - Scaling Application
- Node.js - Packaging
- Node.js - Express Framework
- Node.js - RESTFul API
- Node.js - Buffers
- Node.js - Streams
- Node.js - File System
- Node.js MySQL
- Node.js - MySQL Get Started
- Node.js - MySQL Create Database
- Node.js - MySQL Create Table
- Node.js - MySQL Insert Into
- Node.js - MySQL Select From
- Node.js - MySQL Where
- Node.js - MySQL Order By
- Node.js - MySQL Delete
- Node.js - MySQL Update
- Node.js - MySQL Join
- Node.js MongoDB
- Node.js - MongoDB Get Started
- Node.js - MongoDB Create Database
- Node.js - MongoDB Create Collection
- Node.js - MongoDB Insert
- Node.js - MongoDB Find
- Node.js - MongoDB Query
- Node.js - MongoDB Sort
- Node.js - MongoDB Delete
- Node.js - MongoDB Update
- Node.js - MongoDB Limit
- Node.js - MongoDB Join
- Node.js Modules
- Node.js - Modules
- Node.js - Built-in Modules
- Node.js - Utility Modules
- Node.js - Web Module
- Node.js Useful Resources
- Node.js - Quick Guide
- Node.js - Useful Resources
- Node.js - Dicussion
NodeJS - console.dirxml() Method
The Node.js console.dirxml() method will call the console.log() method at the time of execution by passing the received arguments by dirxml() method. No XML formatting is produced by this method.
Assume there is an object with properties and values. If we pass the object name into the console.dirxml() method, it will call the console.log method by passing the received argument (object). Thus it will show the object's properties in the output.
Syntax
Following is the syntax of the Node.js console.dirxml() method −
console.dirxml(data)
Parameters
data − This parameter accepts a JavaScript object or element.
Return value
This method will return the object or element which is been passed.
Example
The Node.js console.dirxml() method will accept only one parameter.
In the example below, we are creating an object with enumerable properties. Then we are passing the object as a parameter to the console.dirxml() method of node.js.
var Family = { Husband : "Jack", wife : "Rose", MarrDuration : "25 years", Kids : 1, KidName : "Jase", } console.dirxml(Family);
Output
As we can see in the output, the family here is an object and we passed it in to console.dirxml() method, then this method will call the console.log() method by passing the received argument.
{ Husband: 'Jack', wife: 'Rose', MarrDuration: '25 years', Kids: 1, KidName: 'Jase' }
Example
The console.dirxml() method of node.js will accept only one parameter.
In this example, we are passing an integer value as a parameter to the console.dirxml() method of node.js.
var x = 10; var y = 10; var z = x + y; console.dirxml(z);
Output
As we can see in the output, we passed an integer value to the console.dirxml() method and then this method will call the console.log() method by passing the received argument.
20
Example
In this example, we are passing a string as an input to the console.dirxml() method.
console.dirxml("Tutorialspoint, Simply Easy Learning at your fingertips");
Output
As we can see in the output, the input string which is passed as a parameter will be printed.
Tutorialspoint, Simply Easy Learning at your fingertips
To Continue Learning Please Login
Login with Google