---
title: "Discussion on \"[JavaScript] 생성자 함수(constructor function)을 통해 알아보는 closure, prototype, this\" | Hashnode"
description: "Discussion on \"[JavaScript] 생성자 함수(constructor function)을 통해 알아보는 closure, prototype, this\". function Person(name, age, id) {\n    var privateId = id;\n\n    this.name = name;\n    this.age = age;\n    this.getPrivateId = function() {\n        return privateId;\n    }\n}\n\nvar gwon = new Person(\"gwon\", 100, 1234);\nconsole.log(gwon.name); // \"gwon\"\nco..."
url: "https://hashnode.com/posts/javascript-constructor-function-closure-prototype-this/656f53910e775655b6c93bbc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[JavaScript\] 생성자 함수(constructor function)을 통해 알아보는 closure, prototype, this](https://gwonhong.hashnode.dev/javascript-constructor-function-closure-prototype-this?utm_source=hashnode&utm_medium=feed)

function Person(name, age, id) { var privateId = id; this.name = name; this.age = age; this.getPrivateId = function() { return privateId; } } var gwon = new Person("gwon", 100, 1234); console.log(gwon.name); // "gwon" co...

Dec 5, 2023 · 5 min read · gwonhong.hashnode.dev  
Updated Dec 6, 2023  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#closures-in-javascript](https://hashnode.com/tag/closures-in-javascript)
-   [#prototype-in-javacsript](https://hashnode.com/tag/prototype-in-javacsript)
-   [#this-keyword-in-javascript](https://hashnode.com/tag/this-keyword-in-javascript)

## Written by

[Gwon Hong](https://hashnode.com/@gwonhong)

@gwonhong · Seoul, KR

  
[View profile](https://hashnode.com/@gwonhong)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
