Moment Clone1.2.0+
moment(Moment);
All moments are mutable. If you want a clone of a moment, you can do so implicitly or explicitly.
Calling moment()
on a moment will clone it.
var a = moment([2012]);
var b = moment(a);
a.year(2000);
b.year(); // 2012
Additionally, you can call moment#clone
to clone a moment.
var a = moment([2012]);
var b = a.clone();
a.year(2000);
b.year(); // 2012
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .