---
title: "Discussion on \"type 和 interface 的区别是什么？\" | Hashnode"
description: "Discussion on \"type 和 interface 的区别是什么？\". 组合方式: interface 使用extends来实现继承，type 使用&来实现联合类型。\n扩展方式: interface 可以重复声明用来扩展，type 一个类型只能声明一次\n范围不同: type 适用于基本类型，interface 一般不行。\n命名方式: interface 会创建新的类型名，type 只是创建类型别名，并没有新创建类型。"
url: "https://hashnode.com/posts/type-interface/626236d10f819f588af7361a"
---

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

Discussion

# [type 和 interface 的区别是什么？](https://lihua.hashnode.dev/type-interface?utm_source=hashnode&utm_medium=feed)

组合方式: interface 使用extends来实现继承，type 使用&来实现联合类型。 扩展方式: interface 可以重复声明用来扩展，type 一个类型只能声明一次 范围不同: type 适用于基本类型，interface 一般不行。 命名方式: interface 会创建新的类型名，type 只是创建类型别名，并没有新创建类型。

Apr 22, 2022 · 1 min read · lihua.hashnode.dev  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)

## Written by

[Xin shen](https://hashnode.com/@lihua)

@lihua · China Beijing

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

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
