Installation configuration
(1) We can go to its release page ( click to jump ) to download babel.js or babel.min.js and reference it on the page.
1 |
|
(2) You can also directly quote the address of the online version
1 |
|
test case
(1) Here we still use the two new features of ES6 let and const as an example. Note: Although our ES6 script is also placed in the script tag, it must be marked with type="text/babel"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
(2) Visit the page and you can see that the ES6 code has been automatically converted to ES5.