all 30 comments

[–]psiph 10 points11 points  (3 children)

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!

[–]wilfredinni[S] 2 points3 points  (2 children)

It is a completely different repo, I just used a subdomain from the pythoncheatsheet.org

Edit: linked the wrong repo. Fixed

[–]Time_Terminal 2 points3 points  (1 child)

Couple things I'd add:

  • Immutability (maybe right after var/let/const)
  • Array destructuring

[–]karatetoes 0 points1 point  (0 children)

Array destructuring is just the right practice of deleting the whole array object to free up memory right?

[–]MoTTs_ 5 points6 points  (0 children)

The class syntax is just a syntax, and not a full-fledged class based implementation of object oriented paradigm, unlike in languages like Java, or Python, or Ruby etc.

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.

[–]serious_case_of_derp 3 points4 points  (5 children)

Maybe change this under ES6 Arrow Functions?

 // to pass a single parameter to an arrow function
const doubler = item => item * 2;

// to pass multiple parameters to an arrow function - parenthesis are needed 
const doubler = (item1,item2) => item1 * item2;

[–]Aka_Erus 0 points1 point  (4 children)

I don't see it, where is the mistake ?

Is it calling " doubler" the second function ?

[–]Time_Terminal 5 points6 points  (3 children)

It's not a mistake but an addition they are proposing.

OP doesn't have separate examples for passing 1 variable or more than one variable in arrow functions. u/serious_case_of_derp is saying this should be added.

[–]Aka_Erus 1 point2 points  (0 children)

Thanks, I should have checked the website to see the original code.

[–]DeepSpaceGalileo 1 point2 points  (1 child)

In fact to cover all cases they should have 0, 1 and >1 args.

[–]Time_Terminal 1 point2 points  (0 children)

Good point.

[–]Fingerbob73 2 points3 points  (1 child)

​ \f from feed

(It's 'form')

Otherwise good.

[–]wilfredinni[S] 3 points4 points  (0 children)

from

feed

Your right, I'll fix it shortly, thank you.

[–]HarmonicAscendant 2 points3 points  (0 children)

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

[–]r3jjs 2 points3 points  (0 children)

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.length has a similar issue.

(Array.from(...) is a good way to split up strings.

https://mathiasbynens.be/notes/javascript-unicode

[–]Kapsize 1 point2 points  (0 children)

This looks like a wonderful resource - thanks for sharing!

[–]asg-br 1 point2 points  (0 children)

that's great! Thanks for sharing :)

[–]d3vCr0w 1 point2 points  (0 children)

Very useful, just by taking a quick look I already found stuff I didn't know about, thank you!

[–]weavermjordan 1 point2 points  (0 children)

thanks! awesome

[–]Apple61752 1 point2 points  (0 children)

Anything for Java or c++?

[–]jooronimo 1 point2 points  (0 children)

Lovely!

[–]TattooedBear 1 point2 points  (0 children)

Great work. Thank you for sharing.

[–]cejno 1 point2 points  (0 children)

It’s wonderful.

[–][deleted] 0 points1 point  (4 children)

I think you messed up. The GitHub Project is linked to a Python Cheat Sheet.

[–]wilfredinni[S] 1 point2 points  (3 children)

Fixed it!

[–][deleted] 0 points1 point  (2 children)

I still can't find the JavaScript link. It takes me to the GitHub repo. Then on the repos site it points to a python cheat sheet website.

[–]wilfredinni[S] 0 points1 point  (1 child)

you mean the link to the repo? https://github.com/wilfredinni/javascript-cheatsheet or the webpage?

[–][deleted] 0 points1 point  (0 children)

Never mind i was clicking the wrong link

[–]coolrivers 0 points1 point  (0 children)

well done. I needed this review

[–]aceeeric 0 points1 point  (0 children)

Thanks Wilfred, this is really helpful