随笔分类 -  CoffeeScript

摘要:CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous hear... 阅读全文
posted @ 2014-10-09 22:37 水之原 阅读(989) 评论(0) 推荐(0) 编辑
摘要:class Map constructor : -> @entry = {} @count = 0 size : -> return @count isEmpty : -> return @count == 0 containsKey : (key) -> if @isEmpty() return false return @entry.hasOwnProperty key containsValue : (val)-> ... 阅读全文
posted @ 2013-12-31 23:46 水之原 阅读(1312) 评论(0) 推荐(0) 编辑
摘要:CoffeeScript is a little language that compiles into JavaScript.Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.The golden rule of CoffeeScript is:"It's just JavaScript&q 阅读全文
posted @ 2013-12-31 23:30 水之原 阅读(1019) 评论(0) 推荐(0) 编辑
摘要:TABLE OF CONTENTSTRY COFFEESCRIPTANNOTATED SOURCECoffeeScript is a little language that compiles into JavaScript.Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a 阅读全文
posted @ 2013-08-08 07:50 水之原 阅读(887) 评论(0) 推荐(0) 编辑
摘要:在没有使用coffee-script之前,我们写类是这样写的,感觉会有点繁锁://-------------抽象类形状--------------function Shape(edges) { this.edges = edges;}Shape.prototype.getArea = function() { return -1;}Shape.prototype.getEdges = function() { return this.edges;}//--------------三角形----------------function Triangle(bottom, heig... 阅读全文
posted @ 2013-01-29 15:23 水之原 阅读(2640) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示