Under what circumstances can class in ES6 not declare constructor?

declare class class: in es6

class Template{
    constructor(){
       /**/
    }
    
    method(){
      /**/
    }
}

or

class Template{
    method(){
       /**/
    }
}

question: under what circumstances can class in
1.ES6 not declare constructor?
2. What"s the difference between the above code?


constructor is used for initialization. If nothing is done in it, there is no difference


when you don't need code to be executed at initialization, you don't need constructor

.

constructor is called automatically when the instance object is created

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b389da-2c130.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b389da-2c130.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?