How to write self-calling function in es6 class?

class A () {
created () {

 alert(1);

}
}

for example, var a=new A ();
how to self-call the created method after creating an object, just like the vue hook

Mar.28,2021


class A{
  constructor(){
    //this.test()
  }
  test(){
    alert(1);
  }
}
var a = new A(); //
a.test(); //1
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-1eafbc5-48050.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-1eafbc5-48050.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?