I wrote the some code and when opened the page in browser (Firefox 20.0), it showed following error in console:
JS: https://unpkg.com/babel-standalone@6/babel.min.js
TypeError: e.forEach is not a function @ https://unpkg.com/babel-standalone@6/babel.min.js:8
CODE:
<script type="text/babel">
let input = [1, 2, 3];
console.log(typeof input);
</script>
I observed that using " let " or " var " doesn't make a difference. It is crashing even before reaching those lines. Why is it so? Am I missing something?
PS: Although I can use NPM and browserify to use babel but i just want to test it using this script.
This appears to be because the version of Firefox you're using is not supported by Lodash, which Babel depends on https://github.com/lodash/lodash/issues/2924
Generally babel-standalone targets standard ES5 environments, but this appears to be a case that we can't address since it is in one of our dependencies.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.