분류 javascript

주어진 값이 영문자 또는 숫자인지 아닌지를 확인하는 JavaScript 함수를 작성하십시오

컨텐츠 정보

  • 조회 955 (작성일 )

본문

코드 :

function is_alphaNumeric(str)
{
 regexp = /^[A-Za-z0-9]+$/;
  
        if (regexp.test(str))
          {
            return true;
          }
        else
          {
            return false;
          }
}

console.log(is_alphaNumeric("37828sad"));

console.log(is_alphaNumeric("3243#$sew"));