인프런 커뮤니티 질문&답변
정규식 관련해서 질문이 있습니다.
작성
·
301
1
const str ='to lose your path is the way ro find that path'
const patt=/([a-f])\w+/i;
console.log(str.match(patt));-
다음과 같은 예제에서 괄호는 어떤 역할을 하는 건가요.
괄호가 있고 없고에 따라 결과가
괄호 없을 때
[ 'ath', input: 'to lose your path is the way ro find that path', groups: undefined ]
괄호 있을 때
[ 'ath', 'a', input: 'to lose your path is the way ro find that path', groups: undefined ]
이와 같이 나옵니다.
퀴즈
객체의 메서드 안에서 `this` 키워드는 주로 무엇을 가리킬까요?
전역 객체 (예: window)
메서드가 포함된 객체 자체
메서드를 호출한 함수
HTML 문서





