How to import two classes by the same name in javascript/es6?

Presumably component/Data and actions/Data both have default exports rather than named exports? Like this: export default class Data {} If that’s the case, then the importer can call the variables whatever they like: import Data1 from ‘component/Data.js’; import Data2 from ‘actions/Data.js’; If they are named exports: export class Data {} Then you need to use … Read more

What is the use case for var in ES6?

If the let keyword introduces a proper implementation of block scope, does var any longer have a use case? There could be one use case: let declarations in global scope don’t create a property on the global object. Example: “use strict”; // for chrome var foo = 42; let bar = 21; console.log(‘window.foo (var)’, window.foo); … Read more