请选择 进入手机版 | 继续访问电脑版
楼主: Reader's
998 11

【独家发布】CoffeeScript in Action [推广有奖]

  • 0关注
  • 0粉丝

博士生

59%

还不是VIP/贵宾

-

TA的文库  其他...

可解釋的機器學習

Operations Research(运筹学)

国际金融(Finance)

威望
0
论坛币
41133 个
通用积分
2.0023
学术水平
7 点
热心指数
5 点
信用等级
5 点
经验
2201 点
帖子
198
精华
1
在线时间
36 小时
注册时间
2015-6-1
最后登录
2024-3-3

Reader's 发表于 2017-7-22 00:56:47 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
CoffeeScript in Action




    1. Author: Patrick Lee

    2. ISBN-10 书号: 1617290629

    3. ISBN-13 书号: 9781617290626

    4. Edition: 1

    5. Release 出版日期: May 22, 2014

    6. pages 页数: (432)


    7. 44.99
    复制代码

    下载地址:

    本帖隐藏的内容

    http://pan.baidu.com/s/1bpFOkTx 密码: jmac








二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝


本帖被以下文库推荐

Reader's 发表于 2017-7-22 00:57:05 |显示全部楼层 |坛友微信交流群
https://en.wikipedia.org/wiki/CoffeeScript

使用道具

Reader's 发表于 2017-7-22 00:58:04 |显示全部楼层 |坛友微信交流群
  1. Interval test[edit]
  2. To compute the body mass index, one may do (here in JavaScript):

  3. var mass = 72
  4. var height = 1.78
  5. var BMI = mass / (height * height)
  6. if (18.5 < BMI && BMI < 25) alert('You are healthy!')
  7. With CoffeeScript the interval is directly described:

  8. mass = 72
  9. height = 1.78
  10. BMI = mass / height**2
  11. alert 'You are healthy!' if 18.5 < BMI < 25
复制代码

使用道具

Reader's 发表于 2017-7-22 00:59:36 |显示全部楼层 |坛友微信交流群
  1. Loops and comprehensions[edit]
  2. To compute the greatest common divisor of two integers with the euclidean algorithm, in JavaScript one usually needs a while loop:

  3. function gcd(x, y) {
  4.   var z
  5.   do {
  6.     z = x % y
  7.     x = y
  8.     y = z
  9.   } while (y != 0)
  10.   return x
  11. }
  12. Whereas in CoffeeScript one can use until and pattern-matching instead:

  13. gcd = (x, y) ->
  14.   [x, y] = [y, x%y] until y is 0
复制代码

使用道具

stormchao 在职认证  发表于 2017-7-22 17:39:05 |显示全部楼层 |坛友微信交流群

Listing 3.5. Counting words


已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

使用道具

Nicolle 学生认证  发表于 2017-7-23 05:44:30 |显示全部楼层 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

Nicolle 学生认证  发表于 2017-7-23 05:45:21 |显示全部楼层 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

Nicolle 学生认证  发表于 2017-7-23 05:49:21 |显示全部楼层 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

Nicolle 学生认证  发表于 2017-7-23 05:51:54 |显示全部楼层 |坛友微信交流群

Listing 3.2. Count words comparison

提示: 作者被禁止或删除 内容自动屏蔽

使用道具

Nicolle 学生认证  发表于 2017-7-23 05:56:51 |显示全部楼层 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 08:45