js判断是否是合法的端口号
时间:2020-07-06 18:44:48
收藏:0
阅读:72
function isPort(port) { if (/^[1-9]\d*|0$/.test(port) && port * 1 >= 0 && port * 1 <= 65535){ return true } return false; }
原文:https://www.cnblogs.com/nihaorz/p/13256050.html
评论(0)