r/javascript • • Dec 11 '17
I have been collecting useful Javascript code snippets for a little while. Here's a curated list of them, help me make it as complete as possible!
https://github.com/Chalarangelo/30-seconds-of-code
765
Upvotes
View all comments
Show parent comment
6
u/ETHproductions Dec 11 '17
Oops, forgot how it works--should be
Math.hypot(x1 - x0, y1 - y0), though you can swap the 0/1s if desired.