zoukankan      html  css  js  c++  java
  • constructor

    object.constructor

    Returns a reference to the Object constructor function that created the instance object. Note that the value of this property is a reference to the function itself, not a string containing the function's name. The value is only read-only for primitive values such as 1, true and "test".

    Description

    All objects (with the exception of objects created with Object.create(null)) will have a constructor property. Objects created without the explicit use of a constructor function (i.e. the object and array literals) will have a constructor property that points to the Fundamental Object constructor type for that object.

    var o = {};
    o.constructor === Object; // true
    
    var o = new Object;
    o.constructor === Object; // true
    
    var a = [];
    a.constructor === Array; // true
    
    var a = new Array;
    a.constructor === Array; // true
    
    var n = new Number(3);
    n.constructor === Number; // true
  • 相关阅读:
    如何复用网页
    sap
    学习方法
    spring + ehcache 实例
    200个 jquery插件
    vs 示例代码浏览器 搜索
    struts jquery 整合
    eclipse clean 后clease 为空
    mvc相关
    css 框架
  • 原文地址:https://www.cnblogs.com/lal520/p/9915198.html
Copyright © 2011-2022 走看看