How can I run a short ES6 (Javascript) program without semicolons?
I have the following code in a jstry.js
file
let v = 1
console.log(v)
I open a CMD window in windows 10, run it and get an error that a semicolon is expected. What can I change (without babel) so that this code is run OK?
Remark: I understand this is supposed to be supported in ES6, and that in actuality it was even supported before but... now comes some explanation that I don't really understand: until ES6 came along and then something (that I don't understand either) happened.
My path is:
PATH=C:\ProgramData\Oracle\Java\javapath;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files C:\Users\user\AppData\Local\Android\Sdk\tools;
C:\Program Files\nodejs\;
C:\Program Files\Java\jdk1.8.0_172\bin;
C:\Program Files\Microsoft VSCode\bin;
C:\Users\user\AppData\Roaming\npm;
C:\Users\user\AppData\Local\Programs\Microsoft VSCode\bin;
So maybe running in the cmd window is invoking nodeJS? I'm running 8.11.1