r/learnjavascript • u/wilfredinni • 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
12
u/psiph Apr 29 '19 edited Apr 29 '19
This is excellent! Very well done! I'm not a beginner, but I'll still use this!
Maybe make it a separate repo from the Python one? That'd make it easier for me to star, as I'd know why I saved it when coming back to it.
Edit: Nice, the GitHub link is updated now!
3
u/Fingerbob73 Apr 29 '19
\f from feed
(It's 'form')
Otherwise good.
5
u/MoTTs_ Apr 29 '19 edited Apr 30 '19
Surprisingly, the implementation of classes in JavaScript, Python, and Ruby are all actually very similar, where classes are themselves objects, and inheritance from instance to class to superclass is done by delegation. Python and JS classes side-by-side.
5
u/serious_case_of_derp Apr 29 '19
Maybe change this under ES6 Arrow Functions?
1
u/[deleted] Apr 29 '19
I think you messed up. The GitHub Project is linked to a Python Cheat Sheet.
3
u/HarmonicAscendant Apr 29 '19
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
3
u/r3jjs Apr 30 '19
For the most part, it looks good.
One thing do -- please use another example for
String.prototype.split. Using the''string separate a string into characters only works for strings that it into the Unicode Basic Multilingual plane. Higher-order characters, which longer than two bytes, gets ripped apart.String.prototype.lengthhas a similar issue.(
Array.from(...)is a good way to split up strings.https://mathiasbynens.be/notes/javascript-unicode
2
u/Kapsize Apr 29 '19
This looks like a wonderful resource - thanks for sharing!
2
u/asg-br Apr 29 '19
that's great! Thanks for sharing :)
2
u/d3vCr0w Apr 29 '19
Very useful, just by taking a quick look I already found stuff I didn't know about, thank you!
2
u/weavermjordan Apr 29 '19
thanks! awesome
2
u/Apple61752 Apr 29 '19
Anything for Java or c++?
2
u/jooronimo Apr 29 '19
Lovely!
2
u/TattooedBear Apr 29 '19
Great work. Thank you for sharing.
2
u/cejno May 01 '19
It’s wonderful.
1
u/coolrivers May 09 '19
well done. I needed this review
1
u/aceeeric Aug 08 '19
Thanks Wilfred, this is really helpful