Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The complete ES module upgrade guide - part 6
// index.js
import { counter, increment } from './module';
console.log(counter);
increment();
console.log(counter);
// module.js
export let counter = 0;
export const increment = () => {
counter += 1;
}
// 0
// 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.