hasOwnProperty(RegExp - JavaScript)

문자열에 지정된 특성이 있는지 확인합니다.

정의 위치

RegExp(Standard - JavaScript)

구문

hasOwnProperty(property:string) : boolean
매개변수 설명
property 특성 이름입니다.
리턴 값 설명
boolean 오브젝트에 특성이 있으면 true이고 없으면 false입니다.

예제

다음 예제는 세 특성에 대해 true 또는 false를 리턴합니다.
var regexp = /(Moscow)/;
return "constructor = " + regexp.hasOwnProperty("constructor") +
	"\nlength = " + regexp.hasOwnProperty("length") +
	"\nprototype = " + regexp.hasOwnProperty("prototype")