As the new JavaScript ES6 is launched. I am trying to know how do I specify the version.
Suppose, if I want to use HTML5, I declare at the top of the html page
<!DOCTYPE HTML>
Similarly, if I think to use jQuery then I do use jQuery 2.1.4 or any I do it the src pointing to below url
https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js
This is how we write js in html.
<script type="text/javascript">
//js
</script>
or
<script type="text/javascript" src="external.js"> </script>
How do I specify that version ES6 should be used for the script, in case it is not supported by browser, fall back to ES5.