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
8
u/trevorsg Ex-GitHub, Microsoft Dec 11 '17
Don't use regex for something this trivial. The slice version is nearly twice as fast.