{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

编写可维护的JavaScript

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

编写可维护的JavaScript

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

《编写可维护的JavaScript》适合前端开发工程师、JavaScript程序员和学习JavaScript编程的读者阅读,也适合开发团队负责人、项目负责人阅读。
Content Description

任何语言都需要强调编码风格的一致性。只要是团队开发,每个人都以相同方式编写代码就是至关重要的。这样大家才能方便地互相看懂和维护对方的代码。
《编写可维护的JavaScript》向开发人员阐述了如何在团队开发中编写具备高可维护性的JavaScript代码,书中详细说明了作为团队一分子,应该怎么写JavaScript。本书内容涵盖了编码风格、编程技巧、自动化、测试等几方面,既包括具体风格和原则的介绍,也包括示例和技巧说明,最后还介绍了如何通过自动化的工具和方法来实现一致的编程风格。
《编写可维护的JavaScript》作者Nicholas C. Zakas是的Web技术专家,也是《JavaScript高级程序设计》一书的作者。他曾是Yahoo!的首席前端开发工程师,在完成了从一名“独行侠”到“团队精英”的蜕变后,他站在前端工程师的角度提炼出众多的很好编程实践,其中包括很多业内专业所推崇的很好法则,而这些宝贵经验正是本书的核心内容。
《编写可维护的JavaScript》适合前端开发工程师、JavaScript程序员和学习JavaScript编程的读者阅读,也适合开发团队负责人、项目负责人阅读。运用本书中讲述的技巧和技术,可以使JavaScript团队编程从侠义的个人偏好的阴霾走出来,走向真正的高可维护性、高效能和高水准。
Author Description

Nicholas C. Zakas,是一名前端开发顾问、作者、演讲家。他在Yahoo! 供职超过5年时间。在这期间,他曾是Yahoo!首页首席前端工程师和YUI代码贡献者。他著有《JavaScript高级程序设计》、《Ajax高级程序设计》和《高性能JavaScript》。
Comments

“本书是一本教你写出具有前瞻性的JavaScirpt代码的完全手册,在团队作战中特别有用。”
——Ryan Grove,Yahoo! YUI工程师

“作者将他十多年工作经验的精华部分浓缩至这本通俗易读的书中。我建议每个开发工程师和在校学生尽早阅读本书。不管你有多少经验,本书中的每一页内容都会让你变得更加优秀且倍受大家欢迎。”
——Lea Verou,Web设计师兼Web开发人员

“ 这是一本前端工程师的指南,指明了在编码过程需要注意的方方面面。提高可维护性是一个非常大的话题,而这本书,是一个非常不错的起点。”
——王保平(玉伯),支付宝Web前端工程师
Catalogue

第一部分编程风格
第1章基本的格式化
1.1缩进层级
1.2语句结尾
1.3行的长度
1.4换行
1.5空行
1.6命名
1.6.1变量和函数
1.6.2常量
1.6.3构造函数
1.7直接量
1.7.1字符串
1.7.2数字
1.7.3null
1.7.4undefined
1.7.5对象直接量
1.7.6数组直接量
第2章注释
2.1单行注释
2.2多行注释
2.3使用注释
2.3.1难于理解的代码
2.3.2可能被误认为错误的代码
2.3.3浏览器特性hack
2.4文档注释
第3章语句和表达式
3.1花括号的对齐方式
3.2块语句间隔
3.3switch语句
3.3.1缩进
3.3.2case语句的“连续执行”
3.3.3default
3.4with语句
3.5for循环
3.6for-in循环
第4章变量、函数和运算符
4.1变量声明
4.2函数声明
4.3函数调用间隔
4.4立即调用的函数
4.5严格模式
4.6相等
4.6.1eval()
4.6.2原始包装类型
第二部分编程实践
第5章UI层的松耦合
5.1什么是松耦合
5.2将JavaScript从CSS中抽离
5.3将CSS从JavaScript中抽离
5.4将JavaScript从HTML中抽离
5.5将HTML从JavaScript中抽离
5.5.1方法1:从服务器加载
5.5.2方法2:简单客户端模板
5.5.3方法3:复杂客户端模板
第6章避免使用全局变量
6.1全局变量带来的问题
6.1.1命名冲突
6.1.2代码的脆弱性
6.1.3难以测试
6.2意外的全局变量
避免意外的全局变量
6.3单全局变量方式
6.3.1命名空间
6.3.2模块
6.4零全局变量
第7章事件处理
7.1典型用法
7.2规则1:隔离应用逻辑
7.3规则2:不要分发事件对象
第8章避免“空比较”
8.1检测原始值
8.2检测引用值
8.2.1检测函数
8.2.2检测数组
8.3检测属性
第9章将配置数据从代码中分离出来
9.1什么是配置数据
9.2抽离配置数据
9.3保存配置数据
第10章抛出自定义错误
10.1错误的本质
10.2在JavaScript中抛出错误
10.3抛出错误的好处
10.4何时抛出错误
10.5try-catch语句
10.6错误类型
第11章不是你的对象不要动
11.1什么是你的
11.2原则
11.2.1不覆盖方法
11.2.2不新增方法
11.2.3不删除方法
11.3更好的途径
11.3.1基于对象的继承
11.3.2基于类型的继承
11.3.3门面模式
11.4关于Polyfill的注解
11.5阻止修改
第12章浏览器嗅探
12.1User-Agent检测
12.2特性检测
12.3避免特性推断
12.4避免浏览器推断
12.5应当如何取舍
第三部分自动化
第13章文件和目录结构
13.1最佳实践
13.2基本结构
第14章Ant
14.1安装
14.2配置文件
14.3执行构建
14.4目标操作的依赖
14.5属性
14.6Buildr项目
第15章校验
15.1查找文件
15.2任务
15.3增强的目标操作
15.4其他方面的改进
15.5Buildr任务
第16章文件合并和加工
16.1任务
16.2行尾结束符
16.3文件头和文件尾
16.4加工文件
第17章文件精简和压缩
17.1文件精简
17.1.1使用YUI Compressor精简代码
17.1.2用Closure Compiler精简
17.1.3使用UglifyJS精简
17.2压缩
17.2.1运行时压缩
17.2.2构建时压缩
第18章文档化
18.1JSDoc Toolkit
18.2YUI Doc
第19章自动化测试
19.1YUI Test Selenium引擎
19.1.1配置一台Selenium服务器
19.1.2配置YUI Test Selenium引擎
19.1.3使用YUI Test Selenium引擎
19.1.4Ant的配置写法
19.2Yeti
19.3PhantomJS
19.3.1安装及使用
19.3.2Ant的配置写法
19.4JsTestDriver
19.4.1安装及使用
19.4.2Ant的配置写法
第20章组装到一起
20.1被忽略的细节
20.2编制打包计划
20.2.1开发版本的构建
20.2.2集成版本的构建
20.2.3发布版本的构建
20.3使用CI系统
20.3.1Jenkins
20.3.2其他CI系统
附录AJavaScript编码风格指南
附录BJavaScript工具集
Book Abstract

方法封装了从DOM中删除一个元素的操作,屏蔽了开发者要访问该元素父节点的需求。
从JavaScript的可维护性而言,门面是非常合适的方式,自己可以完全控制这些接口。你可以允许访问任何底层对象的属性或方法,反之亦然,也就是有效地过滤对该对象的访问。你也可以对已有的方法进行改造,使其更加简单易用(上段示例代码就是一个案例)。底层的对象无论如何改变,只要修改门面,应用程序就能继续正常工作。
门面实现一个特定接口,让一个对象看上去像另一个对象,就称作一个适配器。门面和适配器唯一的不同是前者创建新接口,后者实现已存在的接口。
11.4关于Polyfill的注解
随着 ECMAScript 5和HTML 5的特性开始在各种浏览器中的实现,JavaScript polyfills(也称为 shims)变得流行起来了。一个polyfill是指一种功能的模拟,这些功能在新版本的浏览器中已经有完备定义并原生实现了。例如,ECMAScript 5为数组增加了forEach()函数。该方法可以在ECMAScript 3中模拟,以便在老版本的浏览器中如同新版本一样使用。polyfills的关键是它们模拟的原生功能要以完全兼容的方式来实现。因此在有些浏览器中存在了这些功能,所以有必要检测不同情况下它们的处理是否符合标准的方式。为了达到目的,polyfills经常会给非自己拥有的对象新增一些方法。我不是polyfills的粉丝,不过对于别人使用它们,我表示理解。相比其他的对象修改而言,polyfills是有界限的,是相对安全的。因为原生实现中是存在这些方法并能工作的,有且仅当原生方法不存在时,polyfills才新增这些方法,并且它们和原生版本方法的行为是完全一致的。
polyfills的优点是,当只支持浏览器的原生功能时,它们非常容易删除。如果你选择使用某个polyfill,你自己做好严格审查。要保证它的功能和原生的版本尽可能的近似,多检查一下这种库代码有单元测试并严格验证了这些功能。polyfills的缺点是,它们可能没有精确地实现它们(原生浏览器环境)所缺失的功能,从而给你带来的麻烦比缺失的功能要多得多。
……
Introduction

本书约定
这个图标表示一种提示、建议或一般性的提醒。
这个图标表示一种警告。
使用示例代码
本书是为了帮助你完成你的工作。通常来讲,你可以任意使用本书中的程序和文档。你不需要在这之前联系我们获得使用许可,但若复制程序的关键部分除外。比如,你的程序使用了本书中的多段代码,这不需要获取我们的许可。出售或者散布O'Reilly的书籍的示例代码光盘则需要首先获得授权。通过引用本书的内容或者代码来回答问题不需要预先获得许可,但将本书的示例代码的关键部分合并入你的产品或者文档则需要获得我们的许可。
我们不要求你一定注明本书的出处。一个完整的出处说明应当包括标题、作者、出版社和ISBN。比如:Maintainable JavaScript,作者Nicholas Zakas(O'Reilly)。Copyright 2012 Nicholas Zakas,978-1-449-32768-2。
如何联系我们
对于本书的评论或问题请联系出版商:
美国:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
中国:
北京市西城区西直门南大街2号成铭大厦C座807室(100035)
奥莱利技术咨询(北京)有限公司

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book