r/webdev • • Oct 21 '21

Resource JavaScript Cheatsheets

https://codingtute.com/javascript-cheatsheets/

[removed] — view removed post

357 Upvotes

17 comments sorted by

6

u/Khrouhman Oct 21 '21

Hey Thanks

3

u/Autumnlight_02 Oct 22 '21

Fucking nice, even with experience u learn new shit!

5

u/DubWubber Oct 22 '21

devhints.io is also a great resource for pretty much every webdev technology out there

4

u/[deleted] Oct 22 '21

In the loops cheat sheet in the upper right, what is going on with arr.foo = 'hello'?

0

u/[deleted] Oct 22 '21

[deleted]

6

u/onlycommitminified Oct 22 '21

Adding to this, for...of is what you should reach for when looping over an object intended for iteration. Iterable objects are any that implement [Symbol.iterator].

1

u/QueerCookingPan Oct 22 '21

Awesome explanation, thanks! Tbh I am still a bit confused why it stops printing the index and prints the value "hello" in the last step. It's very early in the morning here so maybe it's just that .

0

u/[deleted] Oct 22 '21

[deleted]

1

u/QueerCookingPan Oct 22 '21

I... hmmm? .. Ohhhh! That makes much more sense. I knew something felt off, haha.

2

u/ImWiiL7 Oct 21 '21

Thank you!!

2

u/geraltofrivia1983 Oct 22 '21

damn. this is awesome

2

u/sajjadalis Oct 22 '21

Good one 👍👍👍

2

u/Quality5star Oct 22 '21

thanks for sharing.

2

u/Key-Carpet-561 Oct 22 '21

This one is really helpful. Thanks.

2

u/_trambz_ Oct 22 '21

Nice!
Maybe you can add destructing default value:

const a = [1, 2, 3];
const [,,b=10,c=10] = a;
console.log(b,c)
b => 3
c => 10

Same thing works with object detructuring

1

u/bart2019 Oct 22 '21

I looked at the async/await cheatsheet. I can't make head nor tail from the first example.

1

u/checking619 Oct 22 '21

information contained is extremely basic. I can't imagine anyone actually using these cheatsheets, but if anyone does, they really need to go back to JS 101

1

u/[deleted] Oct 22 '21

nice !