Created
July 4, 2014 08:34
-
-
Save hehongwei44/005bf7f6836b3064c893 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
/** | |
* | |
* @description: 判断传入的参数的长度是否在给定的有效范围内 | |
* @param: minL->给定的最小的长度 | |
* @param: maxL->给定的最大的长度 | |
* @param: str->待验证的参数 | |
* @return : true表示合理,验证通过 | |
* | |
*/ | |
var isAvaiableLength = function(minL,maxL,str){ | |
return (str.length >= minL && str.length <= maxL) ? true : false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
为何你的代码如此之美