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.
ES6 ("ES Next")
- Understand what modules are and what export and import do.
- Read Using ES6 without an asset bundler
- We broke with CoffeeScript before their switch to version 2
- Understand some key aspects that you will find in code of existing projects
- Understand the section about Lexical Scoping and Variable Safety
- Understand how loops and comprehensions work in CoffeeScript.
- Understand CoffeeScript's operators.
- Revisit CoffeeScript classes.
- Learn about destructuring.
- Understand the difference between
=>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 how different values compare via
- 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 Immediately-Invoked Function Expression (IIFE) 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.
- 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
summethod 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: