Other Books by Alejandro
- Recommended Resources
Introduction
- Who is this book for ?
- What this book covers ?
Chapter 1: Syntax Scenarios
- Code Reuse on Client and Server
- Comparing Ranges
- Embedding JavaScript
- For Loops
Chapter 2: Classes and Objects Scenarios
- Chaining Calls to an Object
- Class Methods and Instance Methods
- Class Variables and Instance Variables
- Cloning an Object (Deep Copy)
- Mixins for classes
- Create an Object Literal if It Does Not Already Exist
- A CoffeeScript Type Function
Chapter 3: Strings Scenarios
- Capitalizing Words
- Finding Substrings
- Generating a Unique ID
- String Interpolation
- Lowercasing a String
- Matching Strings
- Repeating a String
- Repeat method for Strings
- Replacing Sub-Strings Within a String
- Splitting a String
- Trimming Whitespace from a String
- Uppercasing a String
Chapter 4: Arrays Scenarios
- Check if type of value is an Array
- Concatenating Arrays
- Creating a dictionary Object from an Array
- Creating a String from an Array
- Define Ranges Array
- Filtering Arrays
- List Comprehensions
- Mapping Arrays
- Max Array Value
- Reducing Arrays
- Removing Duplicate Elements from Arrays
- Reversing Arrays
- Shuffling Array Elements
- Testing Every Element
- Using Arrays to Swap Variables
- where for arrays of objects
- Python-like Zip Function
Chapter 5: Dates and Times Scenarios
- Calculate the Date of Easter Sunday
- Calculate the Date of Thanksgiving (USA and Canada)
- Get Days Between Two Dates
- Finding the Last Day of the Month
- Finding Last (or Next) Month
- Calculate Phase of the Moon for a Date
Chapter 6: Math Scenarios
- Math Constants
- Faster Fibonacci Algorithm
- Fast Inverse Square Root
- Generating Predictable Random Numbers
- Generating Random Numbers
- Converting Radians and Degrees
- A Random Integer Function
- Working with Exponents and Logarithms
Chapter 7: Functions Scenarios
- Debounce Functions
- When Function Parentheses Are Not Optional
- Recursive Functions
- Splat Arguments
Chapter 8: Metaprogramming Scenarios
- Detecting and Creating Missing Functions
- Extending Built-in Objects
Chapter 9: jQuery Scenarios
- AJAX
- Callback Bindings # using ⇒ instead of ->
- Create a jQuery Plugin
- Ajax Request Without jQuery
- Older Browser Support
Chapter 10: Regular Expressions Scenarios
- Using Heregexes
- Replacing HTML Tags with HTML Named Entities
- Replacing Substrings
- Searching for Substrings
Chapter 11: Networking Scenarios
- Basic Client
- Basic HTTP Client
- Basic HTTP Server
- Basic Server
- Bi-Directional Client
- Bi-Directional Server
Chapter 12: Design Patterns Scenarios
- Adapter pattern
- Bridge Pattern
- Builder Pattern
- Command Pattern
- Decorator Pattern
- Factory Method Pattern
- Interpreter Pattern
- Memento Pattern
- Observer Pattern
- Singleton Pattern
- Strategy Pattern
- Template Method Pattern
Chapter 13: Databases Scenarios
- MongoDB
- SQLite
Chapter 14: Testing Scenarios
- Testing with Jasmine
- <span style=”color: red;”>Running the Tests</span>
- Getting the Tests to Pass
- <span style=”color: green;”>Refactoring the Tests</span>
- Testing with Nodeunit
- <span style=”color: red;”>Running the Tests</span>
- <span style=”color: green;”>Getting the Tests to Pass</span>
- <span style=”color: green;”>Refactoring the Tests</span>