zoukankan      html  css  js  c++  java
  • $.extend 合并对象(处理可传入0个或多个参数)

    function test(options){
                $.extend({ },this.Default,options);
        
                var v = this.Default || options;

                alert(v.name);//传入打印'嘻嘻嘻嘻',不传入打印'呵呵呵'
            }   
            test.prototype.Default = {
             name:'呵呵呵'
            };
            new test({name:'嘻嘻嘻嘻'});
         //js可传入对象,也可不传入,不传入时使用默认
     
     
    function test1(options){
             var defaults = { name: "foo" };
                $.extend({ },defaults,options);
        
                var v = defaults || options;

                alert(v.name);//传入打印'嘻嘻嘻嘻',不传入打印'呵呵呵'
            }   
            new test1({name:'ssss'});
  • 相关阅读:
    Python2.7-zlib
    Python2.7-sqlite3
    Python2.7-dbm、gdbm、dbhash、bsddb、dumbdb
    Python2.7-anydbm
    Python2.7-marshal
    Python2.7-shelve
    Python2.7-copy_reg
    Python2.7-pickle, cpickle
    Python2.7-shutil
    Python2.7-fnmacth
  • 原文地址:https://www.cnblogs.com/yuyedaocao/p/10273081.html
Copyright © 2011-2022 走看看