← [ BACK_TO_NOTES ]

JavaScript 类型与对象模型 MOC

对象、原型链、this、构造与 class 的阅读顺序导航。

#moc #growing #dev #javascript

[!info] related notes

JavaScript 类型与对象模型 MOC

知识总览

filters:
  and:
    - 'file.ext == "md"'
    - 'file.inFolder("z")'
    - 'this.file.links.contains(file)'
    - 'file.path != this.file.path'
formulas:
  knowledge: 'file.asLink(title)'
properties:
  formula.knowledge:
    displayName: 知识
  note.description:
    displayName: Description
  note.mastery:
    displayName: Mastery
views:
  - type: table
    name: 知识总览
    order:
      - formula.knowledge
      - note.description
      - note.mastery
    columnSize:
      formula.knowledge: 280
      note.description: 760
      note.mastery: 56

这个概念为什么出现

很多人把 class 当 Java,把 this 当“定义处绑定”,结果在组件与回调里不断踩坑。本图把对象系统主线串起来。

从这里开始

  1. 对象
  2. 原型
  3. 原型链
  4. this
  5. class

对象与集合

原型与构造

继续深入

自测题

  1. obj.method() 与 const f = obj.method; f() 的 this 为何不同?
  2. class 是否引入了新的对象模型?
答案
  1. this 由调用方式决定:方法调用绑定到接收者,直接调用通常是 undefined/strict 或全局。
  2. 没有;class 主要是原型机制的语法层。
创建于 2026/7/15 更新于 2026/7/15
Digital Biome
Access

键盘导航

j / k / ↑ / ↓
选择对象
Enter / o
打开选择
/ 或 Ctrl+K
全站搜索
i / f / 1–4
筛选当前列表
g → h / l / p / t / a
首页 / 笔记 / 项目 / 工具 / About
r → 1–9
打开所选对象的关联
u
返回上一页
Esc
关闭浮层 / 取消命令;输入框内清空文本