Preface

作者: 闷油瓶小张 | 来源:发表于2015-11-02 15:28 被阅读15次

What Is Underscore?

Underscore.js is a JavaScript library supporting functional programming.

Getting Underscore

The Underscore website has the latest version of the library.

Using Underscore

_.times(4, function() {console.log("Major")});

// (console) Major
// (console) Major
// (console) Major
// (console) Major
var underscore = _.noConflict();

underscore.times(4, function() {console.log("Major")});

// (console) Major
// (console) Major
// (console) Major
// (console) Major

The Source Code for Functional JavaScript

Lemonad library and the official underscore-contrib library

Running the Code in This Book

The source code for Functional JavaScript is available on GitHub.

Notational Conventions

  • Avoid assigning variables more than once.
  • Do not use eval.
  • Do not modify core objects like Array and Function.
  • Favor functions over methods.
  • If a function is defined at the start of a project, then it should work in subsequent stages as well.
  • Functions of zero parameters are used to denote that the arguments don't matter.
  • In some examples, ... is used to denote that the surrounding code segments are being ignored.
  • Text like inst#method denotes a reference to an instance method.
  • I tend to restrict if/else statements to a single line per branch, so I prefer to avoid using curly brackets to wrap the blocks. This saves precious vertical space.
  • I like to use semicolons.

Whom Functional JavaScript Is Written For

Anyone looking to learn more about functional programming.

A Roadmap for Functional JavaScript

Chapter 1, Introducing Functional JavaScript
Chapter 2, First-Class Functions and Applicative Programming
Chapter 3, Variable Scope and Closures
Chapter 4, Higher-Order Functions
Chapter 5, Function-Building Functions
Chapter 6, Recursion
Chapter 7, Purity, Immutability, and Policies for Change
Chapter 8, Flow-Based Programming
Chapter 9, Programming Without Class

Conventions Used in This Book

Using Code Examples

......

相关文章

  • 20180925 How to Read a Book 01

    Preface Accoding to the Preface, we can know something ab...

  • Preface

    The wisdom of life comes from our daily reflections. The ...

  • Preface

    Words: 1.construct n. [C] AC / 'kɒnstrʌkt ; ˋkɑnstrʌkt...

  • Preface

    出口 OUTLET 某种程度上,每个人都口吃。嘴是人表达的出口,我们可以通过嘴来歌唱,说话,嚎叫,哭喊……用各种方...

  • Preface

    ‘‘Go is an open source programming language that makes it...

  • Preface

    Words & Expressions versatile 多才多艺的 conglomerate adj....

  • preface

    【words & expressions & sentences】 1、l brought with me, al...

  • Preface

    I. Summary & Reflection 最开始听到要读的书是关于苏轼的,顿时觉得对胃口。自己最近刚好在看一...

  • Preface

    写在前面:本人对LJ.Smith的原著并未全读,而影视官方的外衍小说Stefan's Diaries也并没有填补我...

  • Preface

    It's june 9, 2017.in this year, I am 27.Sometimes, I have...

网友评论

      本文标题:Preface

      本文链接:https://www.haomeiwen.com/subject/bqjqhttx.html