Posted over 4 years ago. Visible to the public.

Advanced JavaScript [2.5d]

Stepping forward from JavaScript Basics, the goal of this card is for you to be able to read and write more complex ES6+ and CoffeeScript code, and to migrate code from one language to another.
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.


  • Understand what modules are and what export and import do.
  • Understand the meaning of semicolons in JavaScript. You will encounter code with and without them.


  • 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 CoffeeScript documentation is not about version 1
      • If you want to read the documentation for version 1, use an older snapshot saved at or
      • The snapshot should be fully functional, including the "Try CoffeeScript" console. You may need to close the bar at the top to reveal the navigation.
  • Understand some key aspects that you will find in code of existing projects
  • Browsers don't understand CoffeeScript. Find the component in our stack that fixes this.




  • 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.
  • Hints:
  • Write a simple class
    • Class Rectangle, has properties width and height. Offers area method 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 sum method 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)
    • Implement sum in ES5 as an IIFE
  • Find ways to test equality (what humans mean when they say "equal") for the following types.
    • String
    • Number
    • undefined
    • null
    • Array
    • Structured data structures consisting of nested objects, arrays and scalar variables
  • Discuss with our mentor:
    • Now that you have written some JavaScript and Ruby, which one do you like better? Can you point to concrete examples why you think that way?
    • What can tools like CoffeeScript or Lodash.js do to "fix" JavaScript? What can't they fix?

Owner of this card:

Arne Hartherz
Last edit:
5 months ago
by Johanna Hartmann
Posted by Arne Hartherz to makandra Curriculum
This website uses cookies to improve usability and analyze traffic.
Accept or learn more