MomentJS - Inspect


Advertisements

This method gives a machine readable date string which when used again to evaluate the same moment. It is mostly used for debugging purpose.

Syntax

moment().inspect();

Example

var a = moment().inspect();

Output

Inspect

Example

var a = moment(new Date("18/10")).inspect();

Output

Inspect Method

Thus, when you have to debug the output of moment, you can inspect its displayed output.

momentjs_formatting_date_and_time.htm
Advertisements