As Manasov Daniel said
MDN says
Note. This feature is currently not implemented in any browsers. It is implemented in many transpilers, such as the Traceur, Babel, or Rollup compiler.
With newer versions of ECMAScript (before being implemented in browsers), you usually have to translate (compile) the ECMAScript code into JavaScript. The tool of my choice is Babel , although there are many others.
You can install Babel CLI by going to your terminal and entering:
$ npm install
Every time you make changes to your ES, you must recompile JS.
source share