Created: 2014-05-18 17:10
Updated: 2015-12-08 09:03

Developing Javascript with Class

A talk on ECMAScript 6 and Google's Traceur compiler.

By @mikegeyser for JSinSA 2014.

Stop pretending that the Javascript we're writing is object-oriented - because it's not. Stop hacking around prototypal inheritance and embrace "Harmony" - ECMAScript 6. This talk will take a detailed look at writing Javascript with the first class Object-Oriented support coming in the near future, and illustrate the use of Google's Traceur compiler to degrade gracefully into currently executable Javascript.

Take a look at the slides, and follow through the steps in the commit log to see a demo of a simple class structure converted from current javascript to ECMAScript 6 in the browser using the traceur compiler.

  1. Copying old.html to new.html to work from.
  2. Create a blank vehicles2.js to work from.
  3. Implement the Vehicle base class.
  4. Implement the Car class that inherits from Vehicle.
  5. Implement the Truck class that inherits from Vehicle.
  6. Implement the Scooter class that inherits from Vehicle.
  7. Explicitly export Car, Truck, and Scooter from the module.
  8. Add references to the traceur compiler and bootstrapper.
  9. Take out the vehicle reference.
  10. Import the module, and initialise the VehicleFactory.
  11. Win the game.


Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more