es2015 static class properties, es2016 property initializer syntax

https://babeljs.io/docs/plugins/transform-class-properties/#example

ES2016 Property initializer syntax, ES2015 Static class properties

class Bork {
  // ES2016 Property initializer syntax
  instanceProperty = "bork";
  boundFunction = () => {
    return this.instanceProperty;
  }

  // ES2015 Static class properties
  static staticProperty = "babelIsCool";
  static staticFunction = function() {
    return Bork.staticProperty;
  }
}

let myBork = new Bork;

//Property initializers are not on the prototype.
console.log(myBork.prototype.boundFunction); // > undefined

//Bound functions are bound to the class instance.
console.log(myBork.boundFunction.call(undefined)); // > "bork"

//Static function exists on the class.
console.log(Bork.staticFunction()); // > "babelIsCool"

class

Prototype methods

class Rectangle {
  constructor(height, width) {
    this.height = height;
    this.width = width;
  }
  
  get area() {
    return this.calcArea();
  }

  calcArea() {
    return this.height * this.width;
  }
}

const square = new Rectangle(10, 10);

console.log(square.area);

Static methods

class Point {
  constructor(x, y) {
    this.x = x;
    this.y = y;
  }

  static distance(a, b) {
    const dx = a.x - b.x;
    const dy = a.y - b.y;

    return Math.sqrt(dx*dx + dy*dy);
  }
}

const p1 = new Point(5, 5);
const p2 = new Point(10, 10);

console.log(Point.distance(p1, p2));

babel repl

literal notation

var o = {a: 'foo', b: 42, c: {}};

safari

How do you disable viewport zooming on Mobile Safari?

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

js libs

WYSIWYG editor

JavaScript Features Test Cases

https://github.com/tc39/test262

https://github.com/tc39/test262/blob/master/test/built-ins/Array/length/15.4.5.1-3.d-1.js