Cheatsheet for the modern JavaScript
github.com
github.com
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.
* https://zeroturnaround.com/wp-content/uploads/2017/03/regex-...
* https://rumorscity.com/wp-content/uploads/2014/08/10-Best-VI...
It was interesting that these are all bitmap image files at a rather low resolution. The text is so blurry on all of them! It made me wonder: do people actually use these kinds of image cheatsheets? They wouldn't print well, and zooming in on screen just gives blurry text. My old laminated sheets had crisp high-quality printed text.
It would be different if they were in a vector format, of course. But since I'm not printing them anyway, the traditional cheatsheet is no longer a useful format for me. I much prefer a short document like the OP's "cheatsheet" with legible text that I can scroll through on any device without having to zoom in and pan around.
I suppose one could object to the "sheet" part, since you can't print a document like this on a single sheet of letter or A4 paper. But that doesn't bother me at all: I started my programming career on Teletype machines that used roll paper, and we routinely printed out cheatsheets of varying length. There was no set height to a sheet: it ended wherever you tore it off the roll.
What would be a better name for a document like this that serves the purpose of a traditional cheatsheet but is in a format more suited for digital reading? Maybe "A short guide to ..."?
(Updated with more stories)
E.g. "An overview of modern JavaScript" or "Modern JavaScript - Executive Summary"
AFAICT these are low-res previews of high-quality PDF cheat sheets you can buy.
I should have guessed that these were just low-res previews: I read too much into the comment that they were real cheatsheets.
Even with high-quality vector text, though, I wouldn't find them useful because of the layout. It's great if you print them, but if you like to have everything onscreen, a scrolling document is easier to read.
Regex: https://i.imgur.com/f47LvfU.png
Vim: https://i.imgur.com/YLInLlY.png
Latex: no hi res version but PDF + 2nd page! here
Regex: https://i.imgur.com/f47LvfU.png
Vim: https://i.imgur.com/YLInLlY.png
Latex: no hi res version but PDF + 2nd page! here
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; i++) {
setTimeout(function () { console.log(i); }); // => 5, 5, 5, 5, 5
}
for (let i = 0; i < 5; i++) {
setTimeout(function () { console.log(i); }); // => 0, 1, 2, 3, 4
}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)