Created
May 15, 2018 20:59
-
-
Save adrianhorning08/d6c62caec04203066ee9c19bd8884e5c to your computer and use it in GitHub Desktop.
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 validIP(str) { | |
| const arr = str.split('.'); | |
| if (arr.length !== 4) return false; | |
| arr.forEach(el => { | |
| if (el > 255 || el < 1) return false; | |
| }) | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment