CoffeeScript The Smart Way
$4.99
Minimum price
$9.99
Suggested price

CoffeeScript The Smart Way

Learn CoffeeScript by Solving the Most Interesting Scenarios

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

  • Share this book

  • Feedback

    You must own a copy of this Book to access the forums.

    Email the Author(s)

About the Author

Alejandro Garcia
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.

Bundles that include this book

$74.92
Suggested Price
$19.99
Bundle Price

Table of Contents

  • 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>
  • Keep developing your CoffeScript skills
  • About the Author

The Leanpub 45-day 100% Happiness Guarantee

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

See full terms

Do Well. Do Good.

Authors have earned$10,891,199writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

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), EPUB (for phones and tablets) and MOBI (for 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, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub