JavaScript Allongé, the “Six” Edition: Programming from Functions to Classes in ECMAScript 2015

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

JavaScript Allongé is a first and foremost, a book about programming with functions. It’s written in JavaScript, because JavaScript hits the perfect sweet spot of being both widely used, and of having proper first-class functions with lexical scope. If those terms seem unfamiliar, don’t worry: JavaScript Allongé takes great delight in explaining what they mean and why they matter. JavaScript Allongé begins at the beginning, with values and expressions, and builds from there to discuss types, identity, functions, closures, scopes, collections, iterators, and many more subjects up to working with classes and instances. It also provides recipes for using functions to write software that is simpler, cleaner, and less complicated than alternative approaches that are object-centric or code-centric. JavaScript idioms like function combinators and decorators leverage JavaScript’s power to make code easier to read, modify, debug and refactor. JavaScript Allongé teaches you how to handle complex code, and it also teaches you how to simplify code without dumbing it down. As a result, JavaScript Allongé is a rich read releasing many of JavaScript’s subtleties, much like the Café Allongé beloved by coffee enthusiasts everywhere.

Author(s): Reg Braithwaite
Edition: 2
Publisher: Leanpub
Year: 2019

Language: English
Pages: 488

Table of Contents
A Pull of the Lever: Prefaces
About JavaScript Allongé
What JavaScript Allongé is. And isn't.
Foreword to the ``Six'' edition
Forewords to the First Edition
Prelude: Values and Expressions over Coffee
values are expressions
values and identity
A Rich Aroma: Basic Numbers
The first sip: Basic Functions
As Little As Possible About Functions, But No Less
Ah. I'd Like to Have an Argument, Please.
Closures and Scope
That Constant Coffee Craving
Naming Functions
Combinators and Function Decorators
Building Blocks
Magic Names
Summary
Recipes with Basic Functions
Partial Application
Unary
Tap
Maybe
Once
Left-Variadic Functions
Compose and Pipeline
Picking the Bean: Choice and Truthiness
Composing and Decomposing Data
Arrays and Destructuring Arguments
Self-Similarity
Tail Calls (and Default Arguments)
Garbage, Garbage Everywhere
Plain Old JavaScript Objects
Mutation
Reassignment
Copy on Write
Tortoises, Hares, and Teleporting Turtles
Functional Iterators
Making Data Out Of Functions
Recipes with Data
mapWith
Flip
Object.assign
Why?
A Warm Cup: Basic Strings and Quasi-Literals
Stir the Allongé: Objects and State
Encapsulating State with Closures
Composition and Extension
This and That
What Context Applies When We Call a Function?
Method Decorators
Summary
Recipes with Objects, Mutations, and State
Memoize
getWith
pluckWith
Deep Mapping
The Coffee Factory: ``Object-Oriented Programming''
Served by the Pot: Collections
Iteration and Iterables
Generating Iterables
Lazy and Eager Collections
Interlude: The Carpenter Interviews for a Job
Interactive Generators
Basic Operations on Iterables
A Coffeehouse: Symbols
Life on the Plantation: Metaobjects
Why Metaobjects?
Mixins, Forwarding, and Delegation
Later Binding
Delegation via Prototypes
Shared Prototypes
Decaffeinated: Impostors
Finish the Cup: Constructors and Classes
Constructors and new
Why Classes in JavaScript?
Classes with class
Object Methods
Why Not Classes?
Summary
Recipes with Constructors and Classes
Bound
Send
Invoke
Fluent
Colourful Mugs: Symmetry, Colour, and Charm
Con Panna: Composing Class Behaviour
Extending Classes with Mixins
Functional Mixins
Emulating Multiple Inheritance
Preventing Property Conflicts
Reducing Coupling
More Decorators
Stateful Method Decorators
Class Decorators beyond ES6/ECMAScript 2015
Method Decorators beyond ES6/ECMAScript 2015
Lightweight Traits
More Decorator Recipes
After Method Advice
Before Method Advice
Provided and Unless
Method Advice
Closing Time at the Coffeeshop: Final Remarks
The Golden Crema: Appendices and Afterwords
How to run the examples
Thanks!
Reading JavaScript Allongé on Kindle
Copyright Notice
About The Author