Created
January 17, 2014 17:13
-
-
Save zythum/8477316 to your computer and use it in GitHub Desktop.
Revisions
-
zythum created this gist
Jan 17, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #i用户统计点击了多少次页面, 产经理最喜欢统计数据了 i = 0; document.body.addEventListener 'click', ()-> console.log ++i # 很简单的数值交换函数 o.prop1 <=> o.prop2 _switch = (o, prop1, prop2)-> #`var i` i = o[prop2] o[prop2] = o[prop1] o[prop1] = i o; a = p1: '1', p2: '2' _switch a, 'p1', 'p2'