How to test if a variable is a Moment.js object?
<p>My application has an HTML form with some inputs populated from the backend and other inputs being entered by the user (in a <code>time</code> input). An <code>onChange</code> function runs through each input when the user changes a value. </p>

<p>The inputs populated from the backend are converted to <code>moment</code> objects, the user-entered dates are mere strings. This means the <code>onChange</code> function encounters some <code>moment</code> objects, and some strings. I need to know which inputs are <code>moment</code> objects and which aren't. </p>

<p>What's the recommended method for testing if a variable is a <code>moment</code> object? </p>

<p>I've noticed <code>moment</code> objects have a <code>_isAMomentObject</code> property but I'm wondering if there's another way to test if a variable is a <code>moment</code> object.</p>

<p>Another option I've tried is calling <code>moment</code> on the variable regardless. This converts the <code>string</code> variables to <code>moment</code> objects and doesn't seem to effect existing <code>moment</code> objects. </p>