配置对象

配置对象

作者:LAMP小白  点击:1964  发布日期:2013-01-03 21:07:00  返回列表
//我的mioSlider的配置方式得改改了 学了这个之后大有启发!
配置对象模式(configuration object pattern)是一种更整洁的API的方法,尤其是建立一个库或任何将被其他程序使用的代码的情况

mio_lt;scriptmio_gt;
    function addUser(conf) {
        console.log(conf);
    }
    var conf = {
        username: 'haha',
        age: 22
    }
    addUser(conf);
mio_lt;/scriptmio_gt;


上一篇:备忘模式 下一篇:快递查询API
0