var str='2022-02-20 20:05' if(/^\d{4}-\d{2}-\d{2}$/.test(str)){ alert("格式正确!"); }else{ alert('格式错误') }
JS取1到10的随机整数函数 JS遍历json对象