I would like to start writing code using the up and coming ECMAScript 6 (ES6) so as to start getting to grips with the new syntax.
Is there some kind of web resource or browser plugin that I can use to play (write and test code) on what we currently have in regards to ES6?
I was lead to believe that using Google Chrome Canary might be able to help. So I downloaded Canary, I enabled a couple of features in Canary:
Enable Experimental JavaScript (Mac, Windows, Linux, Chrome OS, Android)
Enable web pages to use experimental JavaScript features.
#enable-javascript-harmony Enable
And after testing the let
block scope in a for loop
for (let i = 0; i < 10; i++) {
console.log(i);
}
I got a syntax error:
SyntaxError: Unexpected identifier
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…