校验是否为非零的负整数

5年以前  |  阅读数:404 次  |  编程语言:JavaScript 
function isNInt(value,minLength=null,maxLength=undefined){
    if(!isNum(value)) return false;
    let regexp = new RegExp(`^-[1-9][0-9]${anysicIntLength(minLength,maxLength)}$`);
    return regexp.test(value.toString());
}

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8