Created
November 17, 2018 13:11
-
-
Save daniel12fsp/77c0ee9404258930f0baea872e3ad314 to your computer and use it in GitHub Desktop.
Get from string only numbers
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
| function getOnlyNumbers(str){ | |
| return Array.from(str).filter(Number) | |
| } | |
| console.log(getOnlyNumber("a1b2c")); // ["1", "2"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment