zoukankan      html  css  js  c++  java
  • Object.defineProperty()

    Object.defineProperty() - JavaScript | MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty

    The static method Object.defineProperty() defines a new property directly on an object, or modifies an existing property on an object, and returns the object.

    Note: You call this method directly on the Object constructor rather than on an instance of type Object.


    Object.defineProperty(object1, 'property1', {
    value: 42,
    writable: false
    });

    object1.property1 = 77;
    // throws an error in strict mode

    console.log(object1.property1);
    // expected output: 42

  • 相关阅读:
    7月27日
    7月26日
    7月25日
    7月24日
    UI基础 选项卡
    UI基础 手势
    UI基础 小球拖拽
    UI基础 事件
    UI基础 自定义视图
    UI基础 视图控制器
  • 原文地址:https://www.cnblogs.com/rsapaper/p/9627410.html
Copyright © 2011-2022 走看看