Last active
August 29, 2015 13:56
-
-
Save rwjblue/8929327 to your computer and use it in GitHub Desktop.
ES6 Module Syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// car.js | |
export default function Car() { | |
this.wheels = 4; | |
this.mirrors = 3; | |
} | |
// vehicles.js | |
import Car from './car' | |
var car = new Car(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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