• hasOwnProperty


    /*
        
        var N = function () {
            this.keys = [];
            this.w = {};
            this.m = {}
        };
        N["prototype"].set = function (a, b, c) {
            this.keys["push"](a);
            c ? this.m[":" + a] = b : this.w[":" + a] = b
        };
        N["prototype"].get = function (a) {
            return this.m["hasOwnProperty"](":" + a) ? this.m[":" + a] : this.w[":" + a]
        };
        N["prototype"].map = function (a) {
            for (var b = 0; b < this.keys["length"]; b++) {
                var c = this.keys[b],
                    d = this.get(c);
                d && a(c, d)
            }
        };
    
    
        var x = new N;
    
        x.set("key", "value", true);
    
        var v = x.get("key");
    
        window.alert(v);*/
    
            var c = function () {
                this.name = "";
                this.x = {};
                this.ok = function () {
                    window.alert('ok');
                }
            };
    
            c.prototype.setname = function (name) {
                
    
                this.x["h"] = name;
            }
    
            c.prototype.getname = function () {
                if (this.x.hasOwnProperty("h")) {
                    return this.x["h"];
                }
    
                //window.alert("none");
                return "None";
            }
     
    
            var x = new c;
    
            x.setname('zbw');
    
            window.alert(x.getname());
    
    
            x.setname(function() {
                window.alert("e");
            });
    
    
           var c =  x.getname();
    
            c();
  • 相关阅读:
    Perl 杂记
    Block abstraction view(Create & Reference)
    sed & awk
    multi-voltage design apr
    APR Recipe
    IN2REG group 的时序分析
    关于 clock tree
    ICC Stage Flow
    ocv & derate & crpr
    clock gating check
  • 原文地址:https://www.cnblogs.com/zbw911/p/4062848.html
Copyright © 2020-2023  润新知