Live data from Hacker News

Cheatsheet for the modern JavaScript

github.com

31–37 of 37 posts

Re: Cheatsheet for the modern JavaScript

#31

This is probably a fine resource. Can't really judge it - I avoid JavaScript to the extend humanly possible. But please - could someone end the devaluation of the word cheatsheet . A cheatsheet should be just that - a sheet of paper or its digital equivalent, with a few short, clear notes of essentials. Not a rambling document. Not something with a table of contents.

For ES6, I really like this one: http://es6-features.org/ Not a cheatsheet per-se (nor sold as one), but at least they keep it mostly on one page, it's closer to a cheatsheet and better than a long document.

Re: Cheatsheet for the modern JavaScript

#32
post #29
post #5

I usually just do just enough javascript, but didn't know the difference between let and var, not it makes sense. the explanation of reduce made sense too.

`let` is block scoped, while `var` is function scoped. Essentially: function do_something() { if (true) { var x = 42; let y = 42; } console.log(x); // 42 console.log(y); // Reference error: y is not defined } It's extremely useful in for loops: for (var i = 0; i 5, 5, 5, 5, 5 } for (let i = 0; i 0, 1, 2, 3, 4 }

that makes a lot of sense, I used to just make a brand new unique variable for loops

Re: Cheatsheet for the modern JavaScript

#33
post #30
post #15

Earlier quoted context omitted.

Summary? Overview?

Judging by the downvotes, I think that post was misinterpreted. I was suggesting that the word "cheatsheet" could be replaced by "summary" or "overview". E.g. "An overview of modern JavaScript" or "Modern JavaScript - Executive Summary"

[deleted]

Re: Cheatsheet for the modern JavaScript

#34

Rules for this in JS from top to bottom in priority: 1. The function was called with 'new' 2. The function was called with 'call' or 'apply' specifying an explicit this 3. The function was called via a containing/owning object (context) 4. DEFAUL: global object (expect strict mode--undefined)

You missed out Function.prototype.bind

Re: Cheatsheet for the modern JavaScript

#36
post #24

Earlier quoted context omitted.

Thank you. For comparison, these are real cheatsheets: * https://zeroturnaround.com/wp-content/uploads/2017/03/regex-... * https://rumorscity.com/wp-content/uploads/2014/08/10-Best-VI... * https://wch.github.io/latexsheet/latexsheet-1.png

High res versions: Regex: https://i.imgur.com/f47LvfU.png Vim: https://i.imgur.com/YLInLlY.png Latex: no hi res version but PDF + 2nd page! here https://wch.github.io/latexsheet/

Thanks but due to imgur’s recent update these are even lower resolution than the quick finds in my original post (on mobile). I’ll post full-size links when I get to a PC.

Re: Cheatsheet for the modern JavaScript

#37
post #24

Earlier quoted context omitted.

High res versions: Regex: https://i.imgur.com/f47LvfU.png Vim: https://i.imgur.com/YLInLlY.png Latex: no hi res version but PDF + 2nd page! here https://wch.github.io/latexsheet/

Thanks but due to imgur’s recent update these are even lower resolution than the quick finds in my original post (on mobile). I’ll post full-size links when I get to a PC.

[deleted]
Post reply on HN