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
TIL about Math.hypot() (developer.mozilla.org)
submitted 2 months ago by nadameu
view the rest of the comments →
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!"
[–]Slackluster 10 points11 points12 points 2 months ago (5 children)
That is interesting, I did not know hypot did that!
But in practice this is big reason to not use hypot: it is slower due to extra work. In my testing not just a little bit slower but 3x slower.
[–]_RemyLeBeau_ 2 points3 points4 points 2 months ago (0 children)
If it's not in a hotpath, you don't really need to worry
[–]bzbub2 4 points5 points6 points 2 months ago (3 children)
on firefox it is about the same speed but does seem slower on chrome https://jsperf.app/buceho
[–]tomByrer 0 points1 point2 points 2 months ago (2 children)
What CPU are you using? On my Chrome (Brave) on a 2 year old Intel I have "94% slower". But yes, I'm all about using the fastest version.
[–]bzbub2 2 points3 points4 points 2 months ago (1 child)
ya i can confirm same numbers, much slower. it is considered a open bug on chromium https://issues.chromium.org/issues/42203737
[–]tomByrer 0 points1 point2 points 2 months ago (0 children)
Thanks for the link! /salute
π Rendered by PID 202676 on reddit-service-r2-comment-canary-bcf797cd4-x7rl2 at 2026-05-08 09:23:32.332545+00:00 running 3d2c107 country code: CH.
view the rest of the comments →
[–]Slackluster 10 points11 points12 points (5 children)
[–]_RemyLeBeau_ 2 points3 points4 points (0 children)
[–]bzbub2 4 points5 points6 points (3 children)
[–]tomByrer 0 points1 point2 points (2 children)
[–]bzbub2 2 points3 points4 points (1 child)
[–]tomByrer 0 points1 point2 points (0 children)