I am trying to use react.js. I found a question while I am reading the "get started with react". (link : https://facebook.github.io/react/docs/getting-started.html)
Middle of the page, there is a statement,
Note: If you are using ES2015, you will want to also use the babel-preset-es2015 package.
However, I do not know how to find which one I am using. How could I find which one I am using?
SUM >> How could I know ES version?
However, I do not know how to find which one I am using. How could I find which one I am using?
You can check in the package.json
of your project. Normally, you will find under the devDependencies
property something that looks this way: "babel-preset-es2015": "x.y.z"
(x.y.z being the version you use)
It refers to this npm package
Hope this helps.
EDIT: the answer to your question:
SUM >> How could I know ES version?
is pretty straightforward. Check ES2015 specific syntatic features in your codebase.
If you are using import xy from './xy'
to request your modules, you are using ES6. If you are using var xy = require('./xy')
to request your modules, you are not. ES6 offers a lot more than that though, but there are hundreds of articles about that already. For example classes are new in ES6. Btw, ES6 = ECMAScript 2015: https://en.wikipedia.org/wiki/ECMAScript
Also, if you are using Babel in your project, you are using ES6. For older Browsers, you need to "transpile" the code to work.
Btw, every developer should have heard of ES6 by now, and i highly recommend using it already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With