Scratch JS Scratch JS is a browser extension available for Chrome and Opera. Below is a code example to run in strict mode.Ĭonsole.log("Condition true output: "+testX(true)) So, you have to run your code in scrict mode only. However, most of the features are reserved for only "scrict mode". Once you enable it and restart chrome, you will be able to test your ES6 code in Chrome console (only the features implemented by chrome). To play with ES6 code in Chrome you have to enable Experimental JavaScript from chrome://flags/ Open firefox developer tools and you can test certain ES6 properties/features of ES6.Ĭhrome's experimental JavaScript features are disabled by default. You can find which browser support what features of ES6 from here. Though browsers don't have full support of ES6, but they have started implementing the same. The name of the npm module is traceur-cli. Traceur provides a command line interface too for experimenting with ES6 codes. Below are the steps to make your terminal ready for ES6 with babel. Few of the solutions are given below.īabel also has a npm module installing which you can easily rum ES6 codes in your command window. ![]() You can also test ES6 in your command prompt or terminal. Unlike Babel, here you need to open your developers tool's JavaScript console to see the console output. It provides an online repl too to experiment with ES6. Babel is probably the best and easiest solution to test your ES6 code today. The online playgrounds below does the same and help you to test ES6.īabel Repl is a playground for ECMA script 6 where you can write ES6 code, check the relevant code in ES5 and also the output. Though browsers don't have full support for ES6, but there are few tools which converts your ES6 codes to equivalent ES5 vanilla code which runs fine in browsers. This article contains some of the good solutions for this. But how to test, experiment and play with your ECMA 6 code at this point of time when most of the features are not available on browser by default? Many blogs have already covered all those upcomming awesome features of ES6. ![]() ![]() Many of those features are appearing in the browsers slowly but steadily. ECMA Script 6 is probably the most talked topics in the JavaScript world today.
0 Comments
Leave a Reply. |