7.3.11 HasOwnProperty ( O, P )

抽象操作 HasOwnProperty 用于确定对象是否具有指定属性键的属性。 返回布尔值。 使用参数 OP 调用操作,其中 O 是对象,P 是属性键。 此抽象操作执行以下步骤:

  1. 断言: Type(O) 为 Object 类型。
  2. 断言:IsPropertyKey(P) 为 true
  3. 使 desc 变为 ? O.[[GetOwnProperty]](P)。
  4. 如果 desc undefined,则返回 false
  5. 返回 true

results matching ""

    No results matching ""