如下,錯誤示例:'use strict'class MyDate extends Date{ constructor(){ super();
}
fromDate(date){ var mTimes = super(date);//這里想調用new Date(date)的構造方法
}
}
ES6中用extends繼承時,如何在子類的方法中使用父類的構造方法?
達令說
2018-08-31 09:09:39