adding exercies for steps 2-1 and 2-2

This commit is contained in:
Ken
2019-02-18 17:09:38 -08:00
parent 9ad6f34705
commit baf9dfd5ca
28 changed files with 133 additions and 7 deletions

View File

@@ -0,0 +1,3 @@
export default class DefaultClass {
hello = 'world';
}

View File

@@ -0,0 +1,19 @@
import { namedConst, namedFn, namedObj, namedConstBracket, namedConst as c } from './named';
import * as named from './named';
// Print out the exports
console.log(namedConst);
console.log(c);
console.log(namedFn());
console.log(namedObj);
console.log(namedConstBracket);
// Print out exports through module level import
console.log(named.namedConst);
console.log(named.namedFn());
console.log(named.namedObj);
console.log(named.namedConstBracket);
import DefaultClass from './default';
console.log(new DefaultClass().hello);

View File

@@ -0,0 +1,12 @@
export const namedConst = 5;
export function namedFn() {
return 5;
}
export const namedObj = {
hello: 'world'
};
const namedConstBracket = 10;
export { namedConstBracket };