此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

Class(類)

在物件導向編程(object-oriented programming)中,一個類(Class)定義了一個 object 的性質。類是一個定義了對象的屬性 (properties) 和方法 (methods) 的模板,繪製其他更多具體實例對象的「藍圖」。