Created
November 4, 2016 16:09
-
-
Save andersr/7ccf8928a67646dfed9719377458ad34 to your computer and use it in GitHub Desktop.
Example of namespaced global variable
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
| var utils = { | |
| isEmpty: function (str) { | |
| return str.trim().length === 0 | |
| }, | |
| isEmail: function (email) { | |
| var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/ | |
| return regex.test(email) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment