Skip to content

Instantly share code, notes, and snippets.

@rwjblue
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwjblue/8929327 to your computer and use it in GitHub Desktop.
Save rwjblue/8929327 to your computer and use it in GitHub Desktop.
ES6 Module Syntax
// car.js
export default function Car() {
this.wheels = 4;
this.mirrors = 3;
}
// vehicles.js
import Car from './car'
var car = new Car();
// foobar.js
export var foo = "foo";
export var bar = "bar";
// baz.js
import { foo, bar } from "foobar";
console.log(foo); // "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment