Leanpub Header

Skip to main content

CoffeeScript The Smart Way

Learn CoffeeScript by Solving the Most Interesting Scenarios

CoffeScript will make your life easier, It will make your code more elegant and powerful !!

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
149
Pages
About

About

About the Book

CoffeScript allows you to code with less lines than Javascript, it makes everything easier than Javascript, it's powerful, efficient, it's the language you need to start using from now on.

You write your code in CoffeeScript, then it gets compiled into plain Javascript and it's fully compatible with all your scripts, libraries and frameworks.

The functionality of CoffeScript is incredible, a script coded in Javascript might take you 57 lines of code, when you use CoffeScript you might code the same script in just 13 lines.

People are using CoffeeScript to make games, web development, applications, you name it !! It's easy to learn and this book takes you through a series of scenarios teaching you how to address them in CoffeSccript. (Once you see it in action you will never stop using it !!)

Check out other books from the author:

Javascript Snippets

Up to Speed with Javascript in 59 minutes

Learning Python Programming from Scratch

Appwrite Up and Running

Javascript Challenges

Front End Developer Interview Questions

ReactJS Documentation

Backend Developer Interview Questions

VueJS Documentation

React Redux Documentation

DevOPs

Price

Pick Your Price...

Minimum price

$7.99

$9.99

You pay

$9.99

Author earns

$7.99
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $12.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

A.J. García

I started my coding career back in 2003. Lately I've been involved a lot in Javascript for frontend and the backend.

I would love passing along to you some of the experiences and challenges I've faced over the years.

Contents

Table of Contents

Other Books by Alejandro

  1. Recommended Resources

Introduction

  1. Who is this book for ?
  2. What this book covers ?

Chapter 1: Syntax Scenarios

  1. Code Reuse on Client and Server
  2. Comparing Ranges
  3. Embedding JavaScript
  4. For Loops

Chapter 2: Classes and Objects Scenarios

  1. Chaining Calls to an Object
  2. Class Methods and Instance Methods
  3. Class Variables and Instance Variables
  4. Cloning an Object (Deep Copy)
  5. Mixins for classes
  6. Create an Object Literal if It Does Not Already Exist
  7. A CoffeeScript Type Function

Chapter 3: Strings Scenarios

  1. Capitalizing Words
  2. Finding Substrings
  3. Generating a Unique ID
  4. String Interpolation
  5. Lowercasing a String
  6. Matching Strings
  7. Repeating a String
  8. Repeat method for Strings
  9. Replacing Sub-Strings Within a String
  10. Splitting a String
  11. Trimming Whitespace from a String
  12. Uppercasing a String

Chapter 4: Arrays Scenarios

  1. Check if type of value is an Array
  2. Concatenating Arrays
  3. Creating a dictionary Object from an Array
  4. Creating a String from an Array
  5. Define Ranges Array
  6. Filtering Arrays
  7. List Comprehensions
  8. Mapping Arrays
  9. Max Array Value
  10. Reducing Arrays
  11. Removing Duplicate Elements from Arrays
  12. Reversing Arrays
  13. Shuffling Array Elements
  14. Testing Every Element
  15. Using Arrays to Swap Variables
  16. where for arrays of objects
  17. Python-like Zip Function

Chapter 5: Dates and Times Scenarios

  1. Calculate the Date of Easter Sunday
  2. Calculate the Date of Thanksgiving (USA and Canada)
  3. Get Days Between Two Dates
  4. Finding the Last Day of the Month
  5. Finding Last (or Next) Month
  6. Calculate Phase of the Moon for a Date

Chapter 6: Math Scenarios

  1. Math Constants
  2. Faster Fibonacci Algorithm
  3. Fast Inverse Square Root
  4. Generating Predictable Random Numbers
  5. Generating Random Numbers
  6. Converting Radians and Degrees
  7. A Random Integer Function
  8. Working with Exponents and Logarithms

Chapter 7: Functions Scenarios

  1. Debounce Functions
  2. When Function Parentheses Are Not Optional
  3. Recursive Functions
  4. Splat Arguments

Chapter 8: Metaprogramming Scenarios

  1. Detecting and Creating Missing Functions
  2. Extending Built-in Objects

Chapter 9: jQuery Scenarios

  1. AJAX
  2. Callback Bindings # using ⇒ instead of ->
  3. Create a jQuery Plugin
  4. Ajax Request Without jQuery
  5. Older Browser Support

Chapter 10: Regular Expressions Scenarios

  1. Using Heregexes
  2. Replacing HTML Tags with HTML Named Entities
  3. Replacing Substrings
  4. Searching for Substrings

Chapter 11: Networking Scenarios

  1. Basic Client
  2. Basic HTTP Client
  3. Basic HTTP Server
  4. Basic Server
  5. Bi-Directional Client
  6. Bi-Directional Server

Chapter 12: Design Patterns Scenarios

  1. Adapter pattern
  2. Bridge Pattern
  3. Builder Pattern
  4. Command Pattern
  5. Decorator Pattern
  6. Factory Method Pattern
  7. Interpreter Pattern
  8. Memento Pattern
  9. Observer Pattern
  10. Singleton Pattern
  11. Strategy Pattern
  12. Template Method Pattern

Chapter 13: Databases Scenarios

  1. MongoDB
  2. SQLite

Chapter 14: Testing Scenarios

  1. Testing with Jasmine
  2. <span style=”color: red;”>Running the Tests</span>
  3. Getting the Tests to Pass
  4. <span style=”color: green;”>Refactoring the Tests</span>
  5. Testing with Nodeunit
  6. <span style=”color: red;”>Running the Tests</span>
  7. <span style=”color: green;”>Getting the Tests to Pass</span>
  8. <span style=”color: green;”>Refactoring the Tests</span>

Keep developing your CoffeScript skills

About the Author

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub