댓글 검색 목록

[javascript] 주어진 값이 시간 문자열인지 아닌지를 확인하는 JavaScript 함수를 작성하십시오.

페이지 정보

작성자 운영자 작성일 17-12-30 22:00 조회 1,324 댓글 0

코드 :

function is_timeString(str)
{
 regexp = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/;
  
        if (regexp.test(str))
          {
            return true;
          }
        else
          {
            return false;
          }
}

console.log(is_timeString("11:35:30"));

console.log(is_timeString("90:90:90"));



댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.