# 用类直接创建对象关联到变量

经常是用类的实例，也就是 **new User() ;**&#x7136;而从没想过 只是 new User ,不调用。今天一看到这个 只new ,不调用觉得好奇怪。这样的结果会是什么。有什么用？从而想到， new 这个关键字到底是什么，从前是知道new 一个实例，是先创建一个对象，把函数里的this指向这个对象，并让函数返回这个对象。

原文地址：<https://juejin.im/post/584e1ac50ce463005c618ca2>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sekin.gitbook.io/myjs/class-zen-yang-yong-hao-lei/yong-lei-zhi-jie-chuang-jian-dui-xiang-guan-lian-dao-bian-liang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
