or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
【Typescript】類別
物件導向 (Object Oriented)
所有東西都是物品
所有東西都是物品
建構子
this
要使用class內部的方法、取得class內部的變數要使用this
OOP的三大特性
封裝
不用知道別人的class怎麼寫的就可以直接使用
繼承
可以繼承別的class的內容,並新增自己需要的功能上去
多形
同一個方法在不同子類別裡面,可以有不同的實作方法
getter & setter
用以改變屬性的讀取和賦值行為
修飾符
抽象 Abstract
抽象的方法
抽象的類別
一些參考資料
TSHandbook 中文版
ES6入門-Classes