moment.duration().get(String);
As an alternate to Duration#x()
getters, you can use Duration#get('x')
. All the shorthand keys from moment#add
apply here as well.
duration.get('hours');
duration.get('minutes');
duration.get('seconds');
duration.get('milliseconds');
Invalid durations return NaN
for all units.