万本电子书0元读

万本电子书0元读

顶部广告

Lo-Dash Essentials电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Adam Boduch

出  版  社:Packt Publishing

出版时间:2015-01-27

字       数:119.8万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
If you are a curious JavaScript developer interested simultaneously in tweaking the efficiency of your code, as well as improving the conciseness of it, and maintaining the readability of it, then this is the book for you. Ideally, the book is intended for readers already working on JavaScript projects and using frameworks such as jQuery and Backbone. Even if you're already using Lo-Dash, this book will show you how to use it efficiently. While extensive JavaScript experience isn't a requirement, you should have at least some prior programming experience in order to best understand the concepts presented.
目录展开

Lo-Dash Essentials

Table of Contents

Lo-Dash Essentials

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Working with Arrays and Collections

The difference between arrays and collections

Iterating over collections

Sorting data

Using sortBy()

Maintaining the sort order

Searching for data

Filtering collections

Finding items in collections

Slicing collections into smaller pieces

First and last collection portions

Splitting collections into chunks

Building unique arrays

Transforming collections

Grouping collection items

Counting collection items

Flattening and compacting

Validating some or all items

Unions, intersections, and differences

Summary

2. Working with Objects

Determining an object type

Type coercion

Managing function arguments

Arithmetic

Callable objects

Assigning and accessing properties

Extending objects

Defaults for new objects

Finding keys and values

Iterating over objects

Basic For Each

Including inherited properties

Keys and values

Calling methods

Getting results

Finding methods

Transforming objects

Using pairs

Picking and omitting properties

Inverting keys and values

Creating and cloning objects

Creating objects

Cloning objects

Summary

3. Working with Functions

Binding function contexts

Changing the this keyword

Binding methods

Dynamic methods

Decorating functions

Partials

Function decorators

Function constraints

Limiting call counts

Caching values

Timed execution

Delaying function calls

Deferring function calls

Throttling function calls

Debouncing function calls

Composing and currying functions

Composing functions

Currying functions

Summary

4. Transformations Using Map/Reduce

Plucking values

Mapping collections

Including and excluding properties

Performing calculations

Calling functions

Filtering and mapping

Mapping objects

Working with keys

Calling methods

Mapping key-value pairs

Reducing collections

Summing values

Filtering and reducing

Min, max, and average operations

Reducing objects

Reducing keys

Object accumulators

Binding contexts

Map/reduce patterns

Generic callback functions

Map/reduce chains

Summary

5. Assembling Chains

Creating Lo-Dash wrappers

Chained calls

Wrapping values

Explicit and implicit chaining

Building filters

Multiple filter() calls

Combining filter() with where()

Dropping and taking collection items

Rejecting items

Using initial() and rest()

Testing truth conditions

Testing if a collection contains an item

Everything or anything is true

Counting items

Using length and size()

Grouping using countBy()

Reducing collections

Transformations

Building groups, unions, and unique values

Plucking values

Creating arrays using without()

Finding the min and max values

Finding the index

Using difference() and xor()

Intermediary results

Tapping into chains

Injecting values

Keys and values

Filtered keys and values

Omitting and picking properties

Returning wrappers

Summary

6. Application Building Blocks

Generic functions

Specific functions

Generic function arguments

Using partials

Generic callbacks

Generic wrappers and chains

Generic filters

Returning chains

Composing functions

Composing generic functions

Composing callbacks

Composing chains

Method composition

Creating mixins

Creating an average() function

Creating a distance() function

Summary

7. Using Lo-Dash with Other Libraries

Modules

Organizing your code with modules

Requiring Lo-Dash

Working with Lo-Dash AMD modules

jQuery

Challenges faced by Lo-Dash

Challenges faced by jQuery

Using jQuery instances as collections

Binding functions

Working with jQuery deferred instances

Backbone

Replacing Underscore.js

Full-featured Lo-Dash and Backbone

Enhancing collections and models

Node.js

Installing the Lo-Dash package

Creating a simple command

Custom Lo-Dash builds

Summary

8. Internal Design and Performance

Design principles

Function compilation to base functions

Optimizing for the common case

Loops are simple

Callbacks and function binding

Improving performance

Changing the operation order

Sorting and indexing collections

Bound and unbound callbacks

Lazy evaluation

Caching things

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部