r/learnjavascript • • Apr 29 '19

I made a Javascript cheat sheet

I don't know if it can help someone else besides me, but, here it is the Github Project and the web site I made.

Contributions and feedback are always welcome.

Edit: fixed the repo link.

254 Upvotes

30 comments sorted by

View all comments

3

u/HarmonicAscendant Apr 29 '19

The lessons in this section handle non-browser features. import won't work on a browser directly. However, we can use various tools to create code out of this to make it work in browser.

Cool cheatsheet, but this is plain wrong. You just add type="module" in the HTML. I have been happily using it for over a year, sod IE, all that nonsense is history.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

Make sure you add '.js' at the end of the import. Import will work well in Node 12 now too with 'experimental modules' enabled:

https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff

or just use https://github.com/standard-things/esm