键盘快捷键

使用 跳转章节

使用 S/ 在本书内搜索

使用 ? 显示帮助页面

使用 Esc 隐藏帮助页面

Keys

Keys[object]

Retrieves a list of all property keys defined in object.

  • Returns a List of Atoms. Key order is not guaranteed (objects are hash‑map backed).
  • An error is raised if the argument is not an Object.
Keys[Object[A]];  (* => {} *)

Keys[Object[A, { { #a, 10 }, { #b, #l } }]];  (* => {#a, #b} *)

Let[obj, Object[A, { { #a, 10 }, { #b, #l } }]];
Keys[Set[obj, #d, 1]];  (* => {#a, #b, #d} *)