Created
June 17, 2019 16:35
-
-
Save chvonrohr/c99fbcd9d3f7d5d3553d346b798f8ffc to your computer and use it in GitHub Desktop.
found cool JS snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 123456789 -> 123,456,789 | |
n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment