Posted over 3 years ago. Visible to the public.

Advanced JavaScript

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.

ES6+

CoffeeScript

  • Read and understand the CoffeeScript documentation
  • Understand that CoffeeScript supports implicit returns (like Ruby)
    • Understand that those are not always helpful in JavaScript, especially for event handler functions.
  • Understand how loops and comprehensions work in CoffeeScript
  • Browsers don't understand CoffeeScript. Find the component in our stack that fixes this.

Equality

Closures

Excercises

  • 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
    • 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.
  • 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:

Avatar
Arne Hartherz
Last edit:
about 16 hours ago
by Arne Hartherz
Posted by Arne Hartherz to makandra Curriculum
This website uses cookies to improve usability and analyze traffic.
Accept or learn more