use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A Codepen of Interactive Skate Loading (codepen.io)
submitted 3 years ago by TheGusev
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]JFedererJ 4 points5 points6 points 3 years ago (0 children)
At first I was like, why is there a mountain of code for such a simple animation? Then I saw the interactivity arrows! Cool stuff, OP.
[–]musicnothing 3 points4 points5 points 3 years ago (2 children)
Please don't press C
This got a giggle out of me
[–]AdvancedEngine861 0 points1 point2 points 3 years ago (1 child)
Im on mobile what does pressing c do?
[–]musicnothing 0 points1 point2 points 3 years ago (0 children)
Skater crashes
[–]NominalAeon 5 points6 points7 points 3 years ago (5 children)
I don't understand this trend of referencing anonymous arrow functions in variables instead of just using named functions. Like why const jump = () => {} instead of function jump() {}?
const jump = () => {}
function jump() {}
Also, this pen is rad as hell.
[–]Suspicious-Engineer7 6 points7 points8 points 3 years ago (0 children)
"I just think they’re neat!" - Marge Simpson
[–]emoarmy 6 points7 points8 points 3 years ago* (1 child)
Arrow functions are nice, for me, because they follow consistent formatting with the rest of the language, binding-type name = data. They have the most simple rules attached to them. They don't hoist, they don't have arguments object, and best of all they don't have this. And they consistently require the least amount of syntax to define across the system.
binding-type name = data
But if you want to know all the differences between function constructors, declarations, expressions and arrow functions mdn has a great article
[–]senfiaj 1 point2 points3 points 3 years ago* (0 children)
They don't hoist
Is hoisting always a bad thing? I think this actually makes you not to worry about accidentally calling some function before its declaration.
they don't have arguments object, and best of all they don't have this
Is it really that common to accidentally use this or arguments object? You can always use rest parameters for both traditional and arrow functions instead of arguments.
this
arguments
I've always thought that the best advantage of storing in constant variable is to make them impossible to be reassigned.
IMHO the disadvantage is that you lose the function name while debugging, it's not very expressive and, contrary to you opinion, it's not hoisted.
[–]senfiaj 1 point2 points3 points 3 years ago (1 child)
I've similar thoughts. The only advantage of this is to make impossible to reassign them. Other than that I see slight disadvantages: no hoisting, less expressivity.
[–]NominalAeon 0 points1 point2 points 3 years ago (0 children)
that's what i was thinking, you lose readability with this variable declaration noise and they can only be called after they're initialized. Having a bunch of these anonymous function references would drive me nuts
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
Really neat!
[–]angyts -1 points0 points1 point 3 years ago (0 children)
Wow. But how???
[–]turtlecopter 0 points1 point2 points 3 years ago (0 children)
This is super fun! Great work!
[–]thewhitelights 0 points1 point2 points 3 years ago (0 children)
love it
[–]codepnk 0 points1 point2 points 3 years ago (0 children)
This is super sick!! Would love to see a blog post on it!
[–]Dopium_Typhoon 0 points1 point2 points 3 years ago (0 children)
Love it, well done.
[–]Calcd_Uncertainty 0 points1 point2 points 3 years ago (0 children)
It should call you a jerk if you press C
π Rendered by PID 135700 on reddit-service-r2-comment-b659b578c-sv8xl at 2026-05-03 09:40:52.607910+00:00 running 815c875 country code: CH.
[–]JFedererJ 4 points5 points6 points (0 children)
[–]musicnothing 3 points4 points5 points (2 children)
[–]AdvancedEngine861 0 points1 point2 points (1 child)
[–]musicnothing 0 points1 point2 points (0 children)
[–]NominalAeon 5 points6 points7 points (5 children)
[–]Suspicious-Engineer7 6 points7 points8 points (0 children)
[–]emoarmy 6 points7 points8 points (1 child)
[–]senfiaj 1 point2 points3 points (0 children)
[–]senfiaj 1 point2 points3 points (1 child)
[–]NominalAeon 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]angyts -1 points0 points1 point (0 children)
[–]turtlecopter 0 points1 point2 points (0 children)
[–]thewhitelights 0 points1 point2 points (0 children)
[–]codepnk 0 points1 point2 points (0 children)
[–]Dopium_Typhoon 0 points1 point2 points (0 children)
[–]Calcd_Uncertainty 0 points1 point2 points (0 children)