When Extensions inheritance is used in ES6, how to use the construction method of the parent class in the method of the subclass?

  node.js, question

The following is an example of an error:

'use strict'
 
 class MyDate extends Date{
 
 constructor(){
 super();
 bracket
 
 fromDate(date){
 var mTimes = super(date);  //here you want to call the constructor of new Date(date)
 bracket
 bracket

Without such grammar, writing this way will be wrong. If you want to use it, write it this way.

Your code has more brackets.
 
 constructor(){
 super();
 bracket
 
 fromDate(date){
 var mTimes = new Date(date);
 bracket
 bracket

Class usage