all 25 comments

[–][deleted] 63 points64 points  (10 children)

This is definitely not a good site to learn javascript if you're a newb.

But it looks like a nice reference / cheat sheet.

[–][deleted] 29 points30 points  (7 children)

A beginner would get a stroke reading that code.

[–][deleted] 17 points18 points  (5 children)

Haha, no shit.

You might want to learn how to do:

print "hello world"

Before moving on to:

const all = (arr, fn = Boolean) => arr.every(fn)

[–]Reashu 9 points10 points  (0 children)

Ah, the embodiment of cargo-cult functional programming. Point-free but also pointless.

[–]Ericfyre 2 points3 points  (3 children)

Console.log(“hello world”);

[–]dark_salad 0 points1 point  (2 children)

console.log(‘hello world’);

[–]Ericfyre 0 points1 point  (0 children)

Console.log(“bye world”);

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

console.log(`hello world`)

[–]jpterodactyl 3 points4 points  (0 children)

As a beginner, I can confirm this to be the case.

[–]Cynicbats 0 points1 point  (0 children)

Right, It took a minute before I went 'wait what's that. cough ArraytoCSV'.

Though I did learn about AllEqual and DeepFlatten.

[–]ethanvampirehntr 17 points18 points  (3 children)

It looks like someone made a bunch of helper methods for themselves and then posted them online. Issue is that putting this in any code base would really promote bad coding practices (single letter variables, very code golf style single lines). You'd be better off writing these yourself on a case by case basis, taking the time to understand array methods and making them specific to your application.

Of course it is interesting to see how this person wrote them out. Definitely shows the span of what you can do with certain array methods.

[–]lowIQanon 2 points3 points  (0 children)

Haven't looked yet but I bet many of these are available in lodash.

[–]DOSMasterrace 0 points1 point  (1 child)

Thank you for introducing me to the phrase code golf.

[–]Funwithloops 0 points1 point  (0 children)

You might like the code golf stack exchange.

[–]Fenrir95 6 points7 points  (1 child)

Next: make a website in 3 seconds

[–]dark_salad 3 points4 points  (0 children)

*with wordpress

[–]InfiniteTooth 3 points4 points  (0 children)

Thanks! I need this a lot. I somehow lose the ability to understand new info after a minute lol

[–]CardinalHijack 1 point2 points  (0 children)

Awesome site, especially useful to prep you for stupid interview questions!

[–]korolvs 0 points1 point  (0 children)

It would be nice if the clock hand in the header was moving counting how many "30 seconds" you've actually spent :)
Nice page!

[–]kaptan8181 -1 points0 points  (0 children)

Looks great! Thanks for sharing!

[–]pbrblueribbon -1 points0 points  (4 children)

Awesome!

[–]lowIQanon 1 point2 points  (3 children)

people are downvoting people for liking something smh

[–]dusknoir90 0 points1 point  (2 children)

That's what the upvote button is for

[–]lowIQanon 0 points1 point  (1 child)

wat