부울 생성자 속성은 부울 프로토타입을 생성한 생성자 함수를 반환합니다. -
다음은 JavaScript Boolean 생성자 속성에 대한 코드입니다 -
예시
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
</style>
</head>
<body>
<h1>JavaScript Boolean constructor Property</h1>
<p class="sample"></p>
<button class="btn">CLICK HERE</button>
<h3>Click on the above button to get the boolean constructor function</h3>
<script>
var bool = true;
document.querySelector(".btn").addEventListener("click", () => {
document.querySelector(".sample").innerHTML =
"The boolean constructor function: <br>" + bool.constructor;
});
</script>
</body>
</html> 출력

"여기를 클릭" 버튼을 클릭하면 -
