归档: 2016/3

0

面向接口编程与策略模式

面向接口编程 & 面向对象编程 Interface-based programming, also known as interface-based architecture, is an architectural pattern for implementing modular programming at the component level in an object-orien

0

ECMAScript6:直面Callback Hell

日常开发中使用ajax回调必不可少,尤其当业务复杂起来,你的代码可能是这样的(假设你用jQuery)123456789101112131415161718$.ajax({ url: url1, success: function (data) { //回调1 $.ajax({ url: url2,

0

ECMAScript6:模块化编程

模块The old way传统JavaScript有相当多的模块化方案(AMD,CommonJS,UMD等)。大体都是通过一个外部函数返回一个携带各种闭包的对象,达到将公用的API暴露出来的目的。类似这样1234567891011function Hello(name) { function greeting() { console.log( "Hello " + n