While we don't use CoffeeScript in new projects any more, we require you to understand it enough to work on existing projects that use it.
There's also a video of that talk in our internal library.
- Understand and what and do.
- Read Using ES6 without an asset bundler
- We broke with CoffeeScript before their switch to version 2
- Understand that version 1 transpiled to ES5 while version 2 transpiled to ES6+
- Realize that the current
is not about version 1
- If you want to read the documentation for version 1, use
- Understand some key aspects that you will find in code of existing projects
- Understand the section about
- Understand how work in CoffeeScript.
- Understand CoffeeScript's .
- Revisit .
- Learn about .
- Understand when defining functions. Use the "Try CoffeeScript" web console to play around with this.
- Browsers don't understand CoffeeScript. Find the component in our stack that fixes this.
- Understand the different meanings of
- Understand how CoffeeScript's
ismap to those
- Understand the benefit of LoDash's
- Understand in detail how a simple workaround for classes in ES5 works under the hood.
- Understand the reason for and the problem it solves. Are IIFEs still useful when we have ES6 modules?
- Important: For the following excercies, don't simply use a library or Stackoverflow code for this. You can look at other people's code to see how it works, but you must understand the concepts and be able to implement them on your own.
- You can use CoffeeScript's web console to transpile CoffeeScript code.
- You can use to transpile ES6 code.
- Write a simple class
Rectangle, has properties
areamethod that returns the product of width and height.
- Implement it in CoffeeScript.
- Implement it in ES6.
- Compare the transpiled ES5 output of both. Note their class boilerplates.
- Manually convert the ES6 class to ES5 using the module pattern (see a simple workaround for classes in ES5).
- Write a
sumfunction that takes an arbitrary number of arguments ("rest args") and computes their sum.
- Implement it in ES6, CoffeeScript, and ES5 separately (without using a transpiler)
sumin ES5 as an IIFE
- Write an
isEqual()method that compares objects of the following types:
- typeless object (key/value properties)
- Structured data structures consisting of nested objects, arrays and primitive variables
- Discuss with our mentor: